Skip to content

Commit

Permalink
feat: log in 시 last login 시간 저장 기능
Browse files Browse the repository at this point in the history
  • Loading branch information
Euizzang8001 committed Aug 1, 2024
1 parent 340a93c commit 4a599d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions KUA/student/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def post(self, request):
user = authenticate(username = request.data['username'], password = request.data['password'])
if user is not None:
token = Token.objects.get(user=user)
user.last_login = timezone.now()
user.save()
return Response({"Token": token.key})
else:
return Response(status = 400)
Expand Down

0 comments on commit 4a599d3

Please sign in to comment.