Commit d175a141 authored by Laury Bueno's avatar Laury Bueno
Browse files

Merge branch 'develop' into pdf-certification

parents a307230b eeb72dc7
......@@ -361,12 +361,18 @@ class UserAccessView(views.APIView):
last_login = ''
last_access = ''
last_completed_activity = ''
accesses_7_days = 0
accesses_30_days = 0
if actions:
last_access = self.format_date(actions.filter(verb='access').last().timestamp)
last_completed_activity = self.format_date(actions.filter(verb='answered').order_by('timestamp').last().timestamp)
last_access_obj = actions.filter(verb='access').last()
last_activity_obj = actions.filter(verb='answered').last()
if last_access_obj:
last_access = self.format_date(last_access_obj.timestamp)
if last_activity_obj:
last_completed_activity = self.format_date(last_completed_activity_obj.timestamp)
last_login = self.format_date(user.last_login)
time_delta = timezone.now() - timedelta(days=7)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment