Skip to content

Commit

Permalink
Merge pull request #791 from Lunatic-Labs/fix-superadmin
Browse files Browse the repository at this point in the history
Fixing superadmin
  • Loading branch information
sah0017 authored Nov 26, 2024
2 parents 2f1f261 + e06d67e commit c1d4bb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BackEndFlask/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def create_user(user_data):
lms_id=user_data["lms_id"],
consent=user_data["consent"],
owner_id=user_data["owner_id"],
is_admin="role_id" in user_data.keys() and user_data["role_id"]==3,
is_admin="role_id" in user_data.keys() and user_data["role_id"] in [1,2,3],
has_set_password=has_set_password,
reset_code=None
)
Expand Down Expand Up @@ -243,7 +243,7 @@ def load_SuperAdminUser():
"lms_id": 0,
"consent": None,
"owner_id": None,
"role_id": None,
"role_id": 2,
"is_admin": True
})

Expand Down
2 changes: 1 addition & 1 deletion FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class AdminAddUser extends Component {
"first_name": firstName,
"last_name": lastName,
"email": email,
"lms_id": lmsId != "" ? lmsId : null,
"lms_id": lmsId !== "" ? lmsId : null,
"consent": null,
"owner_id": cookies.get('user')['user_id'],
"role_id": navbar.props.isSuperAdmin ? 3 : role
Expand Down

0 comments on commit c1d4bb6

Please sign in to comment.