Skip to content

Instantly share code, notes, and snippets.

@alexanderjulo
Created October 28, 2012 15:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjulo/3968928 to your computer and use it in GitHub Desktop.
Save alexanderjulo/3968928 to your computer and use it in GitHub Desktop.
@celery.task(name='questionnaire.suitability')
@with_request_context
def questionnaire_suitability(uid, suitable, treatment, explanation):
[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)
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