Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultipleObjectsReturned: get() returned more than one Variable #120

Open
papousek opened this issue Jul 6, 2015 · 0 comments
Open

MultipleObjectsReturned: get() returned more than one Variable #120

papousek opened this issue Jul 6, 2015 · 0 comments
Assignees
Labels

Comments

@papousek
Copy link
Member

papousek commented Jul 6, 2015

Internal Server Error: /flashcards/practice/
Traceback (most recent call last):
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/utils/decorators.py", line 105, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/lazysignup/decorators.py", line 45, in wrapped
    return func(request, *args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/transaction.py", line 394, in inner
    return func(*args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso_flashcards/views.py", line 272, in practice
    saved_answers = _save_answer(request, answers)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso_flashcards/views.py", line 350, in _save_answer
    db_answer.save()
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/base.py", line 589, in save
    force_update=force_update, update_fields=update_fields)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/base.py", line 626, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso/django/util.py", line 16, in wrapper
    signal_handler(*args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso_models/models.py", line 886, in insert_ab_values
    instance.save()
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/base.py", line 589, in save
    force_update=force_update, update_fields=update_fields)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/base.py", line 626, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso/django/util.py", line 16, in wrapper
    signal_handler(*args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso_models/models.py", line 874, in update_predictive_model
    item_asked=instance.item_asked_id)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso/models/prediction.py", line 33, in predict_and_update
    environment, data, prediction, user, item, correct, time, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso/models/prediction.py", line 231, in update_phase
    environment.write('current_skill', current_skill, user=user, item=item, time=time)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/proso_models/models.py", line 378, in write
    variable = Variable.objects.get(**data)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/var/www/slepemapy.cz/virtualenv/geography-production-2/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
    num if num <= MAX_GET_RESULTS else 'more than %s' % MAX_GET_RESULTS
MultipleObjectsReturned: get() returned more than one Variable -- it returned 2!

Request repr():
<WSGIRequest
path:/flashcards/practice/,
GET:<QueryDict: {u'all': [u'True'], u'stats': [u'True'], u'contexts': [u'["europe"]'], u'avoid': [u'[350]'], u'limit': [u'2'], u'types': [u'["state"]'], u'categories': [u'[]']}>,
@papousek papousek added the bug label Jul 6, 2015
@papousek papousek added this to the proso-apps-stabilize milestone Jul 6, 2015
@papousek papousek self-assigned this Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant