DjangoGirls / djangogirls

Website for DjangoGirls.org
http://djangogirls.org/
BSD 3-Clause "New" or "Revised" License
465 stars 286 forks source link

Coach.MultipleObjectsReturned: get() returned more than one Coach -- it returned 3! #757

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 2 years ago

Sentry Issue: DJANGO-GIRLS-WEBSITE-3H

Coach.MultipleObjectsReturned: get() returned more than one Coach -- it returned 3!
(8 additional frame(s) were not displayed)
...
  File "django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "django/contrib/admin/options.py", line 1540, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "django/contrib/admin/options.py", line 1561, in _changeform_view
    obj = self.get_object(request, unquote(object_id), to_field)
  File "django/contrib/admin/options.py", line 763, in get_object
    return queryset.get(**{field.name: object_id})
  File "django/db/models/query.py", line 439, in get
    raise self.model.MultipleObjectsReturned(
marksweb commented 2 years ago

@amakarudze This looks like a potential data problem with a coach.

Hopefully there's something we can do to prevent it once you can establish what the issue is with the data.

amakarudze commented 2 years ago

Yes @marksweb , it is a data problem. Will check the data and revert.

amakarudze commented 2 years ago

This is a data error. The coach was saved 3 times. Now only one instance remains. Not sure if we can do anything about this since names are not unique @marksweb.