From bbcf5c5312b2a5749e6383ef6eec658a317ad8d8 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <pjentsch@sfb1288inf-Laptop.fritz.box>
Date: Thu, 23 Apr 2020 09:40:43 +0200
Subject: [PATCH] Add some documentation

---
 app/decorators.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/decorators.py b/app/decorators.py
index a6a25fa1..0a361424 100644
--- a/app/decorators.py
+++ b/app/decorators.py
@@ -16,7 +16,14 @@ def admin_required(f):
 
 
 def background(f):
-    ''' This decorator executes a function in a Thread '''
+    '''
+    ' This decorator executes a function in a Thread.
+    ' Decorated functions need to be executed within a code block where an
+    ' app context exists.
+    '
+    ' NOTE: An app object is passed as a keyword argument to the decorated
+    '       function.
+    '''
     @wraps(f)
     def wrapped(*args, **kwargs):
         kwargs['app'] = current_app._get_current_object()
-- 
GitLab