Skip to content

Commit

Permalink
fixed family_name issue in login because everyone doesnt have a famil…
Browse files Browse the repository at this point in the history
…y_name
  • Loading branch information
singhchanmeet committed Nov 14, 2023
1 parent a1151b5 commit 3c76664
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 1 deletion.
Binary file added backend.zip
Binary file not shown.
Binary file added backend/authentication.zip
Binary file not shown.
Binary file added backend/core.zip
Binary file not shown.
Binary file added backend/employee.zip
Binary file not shown.
Binary file added backend/media.zip
Binary file not shown.
Binary file added backend/media/student/aadhar/01296402722.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added backend/media/student/pancard/01296402722.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/student.zip
Binary file not shown.
7 changes: 6 additions & 1 deletion backend/student/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ def msteams(self, request):

token = request.identity_context_data._access_token
decoded_token = jwt.decode(token , options={"verify_signature": False})
full_name = f"{decoded_token['given_name']} {decoded_token['family_name']}"

given_name = decoded_token.get('given_name')
family_name = decoded_token.get('family_name')

full_name = f"{given_name} {family_name}" if family_name is not None else f"{given_name} "
#because everyone doesnt have a family name just like aman

student_id = {
"user_id": request.identity_context_data.username,
Expand Down

0 comments on commit 3c76664

Please sign in to comment.