Skip to content

Commit 8a7a17d

Browse files
committed
Updated vertify role in get_all_unpublished_event
1 parent d87c5ce commit 8a7a17d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

backend/api/event.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,8 @@ def get_all_unpublished_event(org_id):
129129
Event.organization_id == org_id).all()
130130

131131
user = request.user
132-
print("TESTING--------")
133-
print(Role.role)
134-
print("TESTING--------")
135-
136-
if user.roles.filter(Role.role == Roles.MEMBER):
132+
member = db.session.query(Role).filter(Role.user_id == user.user_id).first()
133+
if member.role == Roles.MEMBER:
137134
return {'message': 'You are not allowed to see unpublished event',
138135
'success': False}
139136

0 commit comments

Comments
 (0)