aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/decorators.py
diff options
context:
space:
mode:
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