Skip to content

Commit

Permalink
Merge pull request #2835 from stveit/webfront.remove-except-block-tha…
Browse files Browse the repository at this point in the history
…t-does-nothing

Remove try-except block that does nothing
  • Loading branch information
stveit authored Feb 28, 2024
2 parents cbdf13f + 751b534 commit d533e8f
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions python/nav/web/webfront/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,12 @@ def do_login(request):
LogEntry.add_log_entry(
account, 'log-in', '{actor} logged in', before=account
)

try:
request.session[ACCOUNT_ID_VAR] = account.id
request.account = account
except ldap.Error as error:
errors.append('Error while talking to LDAP:\n%s' % error)
else:
_logger.info("%s successfully logged in", account.login)
if not origin:
origin = reverse('webfront-index')
return HttpResponseRedirect(origin)
request.session[ACCOUNT_ID_VAR] = account.id
request.account = account
_logger.info("%s successfully logged in", account.login)
if not origin:
origin = reverse('webfront-index')
return HttpResponseRedirect(origin)
else:
_logger.info("failed login: %r", username)
errors.append(
Expand Down

0 comments on commit d533e8f

Please sign in to comment.