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

get() returned more than one EventParticipant -- it returned 2! #305

Closed
hancush opened this issue May 18, 2018 · 2 comments
Closed

get() returned more than one EventParticipant -- it returned 2! #305

hancush opened this issue May 18, 2018 · 2 comments
Labels

Comments

@hancush
Copy link
Collaborator

hancush commented May 18, 2018

MultipleObjectsReturned: get() returned more than one EventParticipant -- it returned 2!
  File "django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "django/views/generic/base.py", line 157, in get
    context = self.get_context_data(**kwargs)
  File "councilmatic_core/views.py", line 159, in get_context_data
    context.update(self.extra_context())
  File "lametro/views.py", line 52, in extra_context
    extra['current_meeting'] = self.event_model.current_meeting()
  File "lametro/models.py", line 300, in current_meeting
    return calculate_current_meetings(found_events)
  File "lametro/utils.py", line 77, in calculate_current_meetings
    if legistar_meeting_progress(previous_meeting):
  File "lametro/utils.py", line 109, in legistar_meeting_progress
    organization_name = EventParticipant.objects.get(event_id=event.ocd_id).entity_name.strip()
  File "django/db/models/manager.py", line 122, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "django/db/models/query.py", line 391, in get
    (self.model._meta.object_name, num)

Sentry link: https://sentry.io/datamade/lametro-councilmatic/issues/558790581/

I've just run import_data locally and then queried for event_ids with more than one EventParticipant (select event_id from councilmatic_core_eventparticipant group by event_id having count(*) > 1), but found none. I suspect something was deleted and recreated (hence, import_data on a fresh system would not contain the duplicate). If that is the case, this is related to opencivicdata/pupa#295 err, no, that doesn't make sense.

@hancush
Copy link
Collaborator Author

hancush commented May 18, 2018

(In the meantime, I've removed the offending code from the homepage in #304.)

@hancush hancush added the bug label May 18, 2018
@hancush
Copy link
Collaborator Author

hancush commented Jan 18, 2020

This code path has been removed.

@hancush hancush closed this as completed Jan 18, 2020
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