Skip to content

Commit

Permalink
Update trainings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HadronCollider authored May 24, 2024
1 parent 1850e88 commit ea851a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/api/trainings.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,11 @@ def get_all_trainings() -> (dict, int):
print(number_page, count_items)

authorized = check_auth() is not None
if not (check_admin() or (authorized and [session.get('session_id')] == username)):
if not authorized:
return {}, 404

elif not check_admin():
filters['username'] = [session.get('session_id')]

trainings = GetAllTrainingsFilterManager().query_with_filters(filters, number_page, count_items)

trainings_json = {'trainings': {}}
Expand Down

0 comments on commit ea851a4

Please sign in to comment.