File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1010logger = logging .getLogger (__name__ )
1111
1212
13- def we_want_async ():
13+ def we_want_async (* args , ** kwargs ):
1414 from dojo .utils import get_current_user
1515 from dojo .models import Dojo_User
1616
17+ sync = kwargs .get ('sync' , False )
18+ if sync :
19+ logger .debug ('dojo_async_task: running task in the foreground as sync=True has been found as kwarg' )
20+ return False
21+
1722 user = get_current_user ()
1823
1924 if Dojo_User .wants_block_execution (user ):
@@ -28,7 +33,7 @@ def we_want_async():
2833def dojo_async_task (func ):
2934 @wraps (func )
3035 def __wrapper__ (* args , ** kwargs ):
31- if we_want_async ():
36+ if we_want_async (* args , ** kwargs ):
3237 return func .delay (* args , ** kwargs )
3338 else :
3439 return func (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments