Skip to content

Commit

Permalink
fixed bug in lboardsave
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaustuv942 committed Oct 3, 2020
1 parent 7bfbe6a commit eafadc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def post(self, request):
user.save()
score = UserScore(user=user,name=data['name'],imgurl = image, email = user.email, current_question = 1, last_modified =datetime.datetime.now().replace(tzinfo=utc))
score.save()
z = UserScore.lboardSave(UserScore)

token = RefreshToken.for_user(user) # generate token without username & password
response = {}
Expand All @@ -157,7 +158,7 @@ def post(self, request):
response['refresh_token'] = str(token)
response['image'] = str(image)
#register on leaderboard
z = UserScore.lboardSave(UserScore)


#adding quiz_finished tag for users who have finished the level
user = User.objects.get(email=data['email'])
Expand Down Expand Up @@ -217,14 +218,15 @@ def post(self,request):
user.save()
score = UserScore(user=user,name=name,imgurl= image, email = user.email, current_question = 1, last_modified =datetime.datetime.now().replace(tzinfo=utc))
score.save()
z = UserScore.lboardSave(UserScore)

token = RefreshToken.for_user(user) # generate token without username & password
response = {}
response['username'] = user.username
response['access_token'] = str(token.access_token)
response['refresh_token'] = str(token)
response['image']= image[0]
z = UserScore.lboardSave(UserScore)

#adding quiz_finished tag for users who have finished the level
player=UserScore.objects.filter(user=user)[0]
active=config.quiz_active(config)
Expand Down

0 comments on commit eafadc3

Please sign in to comment.