Skip to content

Commit

Permalink
chore: Keep single log message for each successful response
Browse files Browse the repository at this point in the history
  • Loading branch information
microamp committed Jul 21, 2024
1 parent 785456f commit a4bb31c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ietf/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,9 @@ def directauth(request):
if user_count == 1 and authenticate(username = user_query.first().username, password = password):
user = user_query.get()
if user_query.filter(person__isnull=True).count() == 1: # Can't inspect user.person direclty here
log.log(f"Direct auth of personless user {user.pk}:{user.username}")
log.log(f"Direct auth success (personless user): {user.pk}:{user.username}")
else:
log.log(f"Direct auth: {user.pk}:{user.person.plain_name()}")
log.log(f"Direct auth success: {username}")
log.log(f"Direct auth success: {user.pk}:{user.person.plain_name()}")
return HttpResponse(json.dumps(dict(result="success")), content_type='application/json')

log.log(f"Direct auth failure: {username} ({user_count} user(s) found)")
Expand Down

0 comments on commit a4bb31c

Please sign in to comment.