Skip to content

Commit

Permalink
Merge pull request #9 from Anas099X/development
Browse files Browse the repository at this point in the history
fixed get user_data error
  • Loading branch information
Anas099X authored Nov 2, 2024
2 parents 78663c2 + 1b26973 commit 8ffdf2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def get(session):
if user_data:
# User is logged in; show profile and logout buttons
name = H4(user_data['data']['attributes']['full_name'],cls="card-title text-2xl")
email = user_data['data']['attributes']['email']
email = user_data.get('data', {}).get('attributes', {}).get('email')

logout_button = A("Logout", href="/logout", cls="btn btn-sm btn-secondary m-1")
profile_image = Img(src=user_data['data']['attributes']['thumb_url'])

Expand Down Expand Up @@ -314,7 +315,8 @@ def get(session):
if user_data:
# User is logged in; show profile and logout buttons
name = H3(user_data['data']['attributes']['full_name'],cls="card-title")
email = user_data['data']['attributes']['email']
email = user_data.get('data', {}).get('attributes', {}).get('email')

logout_button = A("Logout", href="/logout", cls="btn btn-sm btn-secondary m-1")
profile_image = Img(src=user_data['data']['attributes']['thumb_url'])

Expand Down

0 comments on commit 8ffdf2b

Please sign in to comment.