diff --git a/passbook/audit/models.py b/passbook/audit/models.py index 6cf4b09a02..810b9e8ee8 100644 --- a/passbook/audit/models.py +++ b/passbook/audit/models.py @@ -84,6 +84,8 @@ class LoginAttempt(CreatedUpdatedModel): @staticmethod def attempt(target_uid, request): """Helper function to create attempt or count up existing one""" + if not target_uid: + return client_ip, _ = get_client_ip(request) # Since we can only use 254 chars for target_uid, truncate target_uid. target_uid = target_uid[:254] diff --git a/passbook/core/templates/partials/messages.html b/passbook/core/templates/partials/messages.html index 3d4f76f213..94b4644daf 100644 --- a/passbook/core/templates/partials/messages.html +++ b/passbook/core/templates/partials/messages.html @@ -1,6 +1,6 @@ {% if messages %} {% for msg in messages %} -