wger-project / wger

Self hosted FLOSS fitness/workout, nutrition and weight tracker
https://wger.de
GNU Affero General Public License v3.0
3.23k stars 587 forks source link

MultipleObjectsReturned in get_current_workout #44

Closed rolandgeider closed 11 years ago

rolandgeider commented 11 years ago
Traceback (most recent call last):

  File "/home/rge/www/python-django/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/home/rge/www/python-django/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)

  File "/home/rge/www/wger-patched/wger/manager/views/misc.py", line 93, in dashboard
    (current_workout, schedule) = Schedule.objects.get_current_workout(request.user)

  File "/home/rge/www/wger-patched/wger/manager/models.py", line 117, in get_current_workout
    schedule = Schedule.objects.filter(user=user).get(is_active=True)

  File "/home/rge/www/python-django/lib/python2.7/site-packages/django/db/models/query.py", line 407, in get
    (self.model._meta.object_name, num))

MultipleObjectsReturned: get() returned more than one Schedule -- it returned 2!
rolandgeider commented 11 years ago

Could not reproduce