aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/decorators.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-03-04 07:48:14 +0100
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-03-04 07:48:14 +0100
commit1c0ba8fad47489ce987e628605fd106f981d8075 (patch)
treeb381e4c8c910b2f2f282f6dadbda1a8c1938e358 /pyaggr3g470r/decorators.py
parentTypo. (diff)
parentadding refresh rate to the profile form (diff)
downloadnewspipe-1c0ba8fad47489ce987e628605fd106f981d8075.tar.gz
newspipe-1c0ba8fad47489ce987e628605fd106f981d8075.tar.bz2
newspipe-1c0ba8fad47489ce987e628605fd106f981d8075.zip
Merged in jaesivsm/pyaggr3g470r/evol/api (pull request #6)
Evolution Arch, API and new crawler
Diffstat (limited to 'pyaggr3g470r/decorators.py')
-rw-r--r--pyaggr3g470r/decorators.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/pyaggr3g470r/decorators.py b/pyaggr3g470r/decorators.py
index 3e808793..9e8f9c0b 100644
--- a/pyaggr3g470r/decorators.py
+++ b/pyaggr3g470r/decorators.py
@@ -1,10 +1,12 @@
#! /usr/bin/env python
-#-*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
from threading import Thread
from functools import wraps
from flask import g, redirect, url_for, flash
+from flask.ext.babel import gettext
+from flask.ext.login import login_required
from pyaggr3g470r.models import Feed
@@ -20,6 +22,7 @@ def async(f):
thr.start()
return wrapper
+
def feed_access_required(func):
"""
This decorator enables to check if a user has access to a feed.
@@ -37,3 +40,11 @@ def feed_access_required(func):
else:
return func(*args, **kwargs)
return decorated
+
+
+def pyagg_default_decorator(func):
+ @login_required
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ return func(*args, **kwargs)
+ return wrapper
bgstack15