Skip to content

Commit

Permalink
Merge pull request #10 from Anas099X/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Anas099X authored Nov 2, 2024
2 parents 8ffdf2b + e5c226d commit c32c80c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def get(session):
logout_button = Div() # Empty div to maintain layout consistency
profile_image = Img(src="https://github.com/Anas099X/OpenSAT/blob/main/public/banner.png?raw=true")

if camp_id != 7055998 and user_data['data']['attributes']['email'] not in os.getenv("SPECIAL_ACCESS", "").split(","):
if camp_id != 7055998 and user_data.get('data', {}).get('attributes', {}).get('email') not in os.getenv("SPECIAL_ACCESS", "").split(","):
tier = "OpenSAT+"
else:
tier = "Free"
Expand Down Expand Up @@ -611,7 +611,8 @@ def get(session):
modules = question_objects('practice_test')

#check if user is subbed to patreon
if user_data['data']['attributes']['email'] not in os.getenv("SPECIAL_ACCESS", "").split(","):
if user_data.get('data', {}).get('attributes', {}).get('email')
not in os.getenv("SPECIAL_ACCESS", "").split(","):
return RedirectResponse('/patreon')


Expand Down Expand Up @@ -667,7 +668,8 @@ def get(session, practice_num: int, module_number: int):
user_data, camp_id = get_user_data(session)
if camp_id == 7055998:
""
elif user_data['data']['attributes']['email'] in os.getenv("SPECIAL_ACCESS", "").split(","):
elif user_data.get('data', {}).get('attributes', {}).get('email')
in os.getenv("SPECIAL_ACCESS", "").split(","):
""
else:
return RedirectResponse('/patreon')
Expand Down

0 comments on commit c32c80c

Please sign in to comment.