Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove try-except block that does nothing #2835

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading