aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/api/common.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-08 12:07:36 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-08 12:07:36 +0100
commit2378de49ba37116c5bf93054fd6aed65fa44022a (patch)
tree90bb6efddb1d8fc4772c74fcf5dda4dccef74b1a /pyaggr3g470r/views/api/common.py
parentBetter handling of the error logging in the crawler. (diff)
downloadnewspipe-2378de49ba37116c5bf93054fd6aed65fa44022a.tar.gz
newspipe-2378de49ba37116c5bf93054fd6aed65fa44022a.tar.bz2
newspipe-2378de49ba37116c5bf93054fd6aed65fa44022a.zip
Moved duplicate() function in utils.py. Some minor cosmethic changes.
Diffstat (limited to 'pyaggr3g470r/views/api/common.py')
-rw-r--r--pyaggr3g470r/views/api/common.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyaggr3g470r/views/api/common.py b/pyaggr3g470r/views/api/common.py
index bfdc7860..856b4bb9 100644
--- a/pyaggr3g470r/views/api/common.py
+++ b/pyaggr3g470r/views/api/common.py
@@ -1,3 +1,6 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -
+
"""For a given resources, classes in the module intend to create the following
routes :
GET resource/<id>
@@ -54,13 +57,11 @@ def authenticate(func):
and user.activation_key == "":
g.user = user
logged_in = True
-
if logged_in:
return func(*args, **kwargs)
raise Unauthorized({'WWWAuthenticate': 'Basic realm="Login Required"'})
return wrapper
-
def to_response(func):
"""Will cast results of func as a result, and try to extract
a status_code for the Response object"""
bgstack15