Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Adding sanity checks when we retrieve the unique_id/pass from the use…
Browse files Browse the repository at this point in the history
…r/session
  • Loading branch information
ozten committed Sep 21, 2011
1 parent 73d9779 commit c71f86a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion apps/larper/__init__.py
Expand Up @@ -127,7 +127,18 @@ def dn_pass(self):
if they don't auth against the user in the session.
"""
unique_id = self.request.user.unique_id
return (Person.dn(unique_id), get_password(self.request))
password = get_password(self.request)
if unique_id and password:
return (Person.dn(unique_id), password)
else:
# Should never happen
if unique_id == None:
raise Exception("No unique id on the request.user object")
elif password == None:
raise Exception("No password in the session")
else:
raise Exception("unique_id [%s] password length [%d]" %\
(unique_id, len(password)))

def search(self, query):
"""
Expand Down

0 comments on commit c71f86a

Please sign in to comment.