Index: filters/get_subscriptions.py |
diff --git a/filters/get_subscriptions.py b/filters/get_subscriptions.py |
index d5d20768584f4788fab1b1cc46ae68afb35a90b7..4672df367ea75b6c9d20dd8d20d86c1a79e11215 100644 |
--- a/filters/get_subscriptions.py |
+++ b/filters/get_subscriptions.py |
@@ -19,8 +19,12 @@ import tarfile |
import urllib |
import logging |
from ConfigParser import SafeConfigParser |
+subscriptions = None |
def get_subscriptions(_): |
Wladimir Palant
2016/03/09 11:12:27
This shouldn't be a filter but rather a global fun
Sebastian Noack
2016/03/09 11:18:17
I agree that this should rather be a global. Howev
Wladimir Palant
2016/03/09 11:25:51
That's fine IMHO, with something like this functio
Sebastian Noack
2016/03/09 11:54:18
Whether you think it's safe or not, jinja's optimi
Wladimir Palant
2016/03/09 13:50:15
This makes sense because for filters same input sh
|
+ global subscriptions |
+ if not subscriptions is None: |
+ return subscriptions |
try: |
from sitescripts.subscriptions import subscriptionParser |
except ImportError: |
@@ -57,4 +61,5 @@ def get_subscriptions(_): |
subscriptionParser.get_settings = orig_get_settings |
subscriptionParser.calculate_supplemented(result) |
- return result.values() |
+ subscriptions = result.values() |
+ return subscriptions |