Skip to content

Commit

Permalink
docstring for auth handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Karolis Rusenas committed Aug 18, 2015
1 parent 6a7f3ed commit 8b288b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ def get(self):


def allowed():
"""
Decorator for checking whether current user is whitelisted or not.
:return: :raise Exception:
"""

def decorator(func):
def decorated(self, *args, **kwargs):
user = self.get_current_user()
Expand All @@ -130,10 +136,6 @@ def decorated(self, *args, **kwargs):
return self.render('500.html',
code=403,
error="Not authorized")
# self.set_status(403, reason='Not authorized. Contact administrator.')
# self._transforms = []
# self.finish()
# return None

return func(self, *args, **kwargs)
return decorated
Expand Down

0 comments on commit 8b288b7

Please sign in to comment.