Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Husseinfo committed Mar 31, 2024
1 parent 27289fe commit 077c127
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tracker/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ def recognize(request):
user = User.objects.get(id=user_id)
name = 'Unknown' if user_id in (-1, None) else user.first_name + ' ' + user.last_name
last_attendance = user.attendance_set.last()
inout = not last_attendance.inout if last_attendance else True
if confidence >= 85:
Attendance.objects.create(user=user, date=datetime.now(), inout=not last_attendance.inout)
Attendance.objects.create(user=user, date=datetime.now(), inout=inout)
return render(request, 'recognize.html', {'id': user_id, 'name': name, 'confidence': confidence})
return render(request, 'recognize.html', {'confidence': -1})
return render(request, 'recognize.html')
Expand Down

0 comments on commit 077c127

Please sign in to comment.