Merge pull request #90 from sagidayan/API_Dev
only lecturer can join other campus
This commit is contained in:
commit
82dd89ce8f
1 changed files with 3 additions and 2 deletions
|
@ -118,9 +118,10 @@ def joinCampus(token, campusId):
|
||||||
403 - Invalid token or not a lecturer
|
403 - Invalid token or not a lecturer
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not is_lecturer(token):
|
||||||
|
return forbidden("Invalid token or not a lecturer!")
|
||||||
|
|
||||||
user = get_user_by_token(token)
|
user = get_user_by_token(token)
|
||||||
if user is None:
|
|
||||||
return bad_request("Wrong user Token")
|
|
||||||
|
|
||||||
campus = Campus.get_by_id(int(campusId))
|
campus = Campus.get_by_id(int(campusId))
|
||||||
if campus is None:
|
if campus is None:
|
||||||
|
|
Loading…
Reference in a new issue