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

Record sets with duplicate records cause server exception. #608

Open
benanhalt opened this issue Feb 18, 2020 · 2 comments
Open

Record sets with duplicate records cause server exception. #608

benanhalt opened this issue Feb 18, 2020 · 2 comments
Assignees
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system 2 - Record Sets Issues that are related to record sets
Projects

Comments

@benanhalt
Copy link
Contributor

benanhalt commented Feb 18, 2020

Discovered in the course of investigating #601.

#601 (comment)_

@benanhalt
Copy link
Contributor Author

Accessing a record set with duplicates produces the following exception:

Internal Server Error: /api/specify/collectionobject/52356/
Traceback (most recent call last):
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ben/src/specify7/specifyweb/specify/views.py", line 22, in wrapped
    return view(request, *args, **kwargs)
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 43, in _cache_controlled
    response = viewfunc(request, *args, **kw)
  File "/home/ben/src/specify7/specifyweb/specify/views.py", line 30, in wrapped
    return view(request, *args, **kwargs)
  File "/home/ben/src/specify7/specifyweb/specify/views.py", line 44, in view
    return dispatch_func(request, *args, **kwargs)
  File "/home/ben/src/specify7/specifyweb/specify/api.py", line 95, in resource_dispatch
    data = get_resource(model, id, request.GET.get('recordsetid', None))
  File "/home/ben/src/specify7/specifyweb/specify/api.py", line 204, in get_resource
    data['recordset_info'] = get_recordset_info(obj, recordsetid)
  File "/home/ben/src/specify7/specifyweb/specify/api.py", line 218, in get_recordset_info
    rsi = rsis.get(recordid=obj.id)
  File "/home/ben/src/specify7/ve/local/lib/python2.7/site-packages/django/db/models/query.py", line 389, in get
    (self.model._meta.object_name, num)
MultipleObjectsReturned: get() returned more than one Recordsetitem -- it returned 5!
[18/Feb/2020 15:06:58] [ERROR] [django.server:131] "GET /api/specify/collectionobject/52356/?recordsetid=21 HTTP/1.1" 500 7175

@benanhalt benanhalt added the 1 - Bug Incorrect behavior of the product label Feb 18, 2020
@maxpatiiuk maxpatiiuk added this to Unsorted in Forms via automation Sep 14, 2021
@specifysoftware
Copy link

This issue has been mentioned on Specify Community Forum. There might be relevant details there:

https://discourse.specifysoftware.org/t/workbench-data-set-validation-error-more-than-one-picklist-in-specify-7/1080/3

@grantfitzsimmons grantfitzsimmons added 2 - Forms Issues that are related to the form system and removed Unsorted labels Jul 2, 2023
@bronwyncombs bronwyncombs added the 2 - Record Sets Issues that are related to record sets label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system 2 - Record Sets Issues that are related to record sets
Projects
Status: 📋 Backlog
Forms
  
Unsorted
Development

No branches or pull requests

5 participants