Created
October 28, 2012 15:35
-
-
Save alexanderjulo/3968928 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@celery.task(name='questionnaire.suitability') | |
@with_request_context | |
def questionnaire_suitability(uid, suitable, treatment, explanation): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2012-10-28 16:30:35,139: ERROR/MainProcess] Task questionnaire.suitability[d360d01a-5c77-4e63-8a2d-4c54b25f8418] raised exception: TypeError('questionnaire_suitability() takes exactly 2 arguments (4 given)',) | |
Traceback (most recent call last): | |
File "/var/www/virtual/venv/lib/python2.7/site-packages/celery/task/trace.py", line 212, in trace_task | |
R = retval = fun(*args, **kwargs) | |
File "/var/www/virtual/source/tools/celery.py", line 33, in __call__ | |
TypeError: questionnaire_suitability() takes exactly 2 arguments (4 given) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def with_request_context(f): | |
@wraps(f) | |
def wrapper(*args, **kwargs): | |
with www.test_request_context('/'): | |
return f(*args, **kwargs) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment