{"message":["Error occurred fetching from https://coldfish-issue-2808.test.specifysystems.org/api/specify/collectingevent/6/",{"type":"invalidResponseCode","statusText":["Invalid response code 500. Expected one of 200, 201, and 409.","\n This error may indicate a misconfiguration or a bug in Specify. Please\n double check your configuration and report this issue.\n ","Response:"],"responseText":"\n\n
\n \n \n('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]})\n
Request Method: | \nPUT | \n
---|---|
Request URL: | \nhttp://coldfish-issue-2808.test.specifysystems.org/api/specify/collectingevent/6/ | \n
Django Version: | \n2.2.10 | \n
Exception Type: | \nBusinessRuleException | \n
Exception Value: | \n('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \n
Exception Location: | \n/opt/specify7/specifyweb/businessrules/uniqueness_rules.py in check_unique, line 45 | \n
Python Executable: | \n/opt/specify7/ve/bin/python3.8 | \n
Python Version: | \n3.8.0 | \n
Python Path: | \n['/opt/specify7',\n '/opt/specify7',\n '/opt/specify7/ve/bin',\n '/usr/lib/python38.zip',\n '/usr/lib/python3.8',\n '/usr/lib/python3.8/lib-dynload',\n '/opt/specify7/ve/lib/python3.8/site-packages',\n '/opt/specify7'] | \n
Server time: | \nMon, 13 Feb 2023 14:51:04 -0600 | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/exception.py
in inner
\n\n \n This decorator is automatically applied to all middleware to ensure that
no middleware leaks an exception and that the next middleware in the stack
can rely on getting a response instead of an exception.
"""
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | \nValue | \n
---|---|
exc | \nBusinessRuleException('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \n
get_response | \n<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\n\n \n break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)
except Exception as e:
response = self.process_exception_by_middleware(e, request)…
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
view_name = callback.__name__
else: # CBV
Variable | \nValue | \n
---|---|
callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
callback_args | \n() | \n
callback_kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
middleware_method | \n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
resolver | \n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \n
resolver_match | \nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\w+)/(?P<id>\\d+)/$) | \n
response | \nNone | \n
self | \n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \n
wrapped_callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\n\n \n response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
Variable | \nValue | \n
---|---|
callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
callback_args | \n() | \n
callback_kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
middleware_method | \n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
resolver | \n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \n
resolver_match | \nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\w+)/(?P<id>\\d+)/$) | \n
response | \nNone | \n
self | \n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \n
wrapped_callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
/opt/specify7/specifyweb/specify/views.py
in wrapped
\n\n \n from .specify_jar import specify_jar
def login_maybe_required(view):
@wraps(view)
def wrapped(request, *args, **kwargs):
if not request.user.is_authenticated:
return http.HttpResponseForbidden()
return view(request, *args, **kwargs)…
return wrapped
if settings.ANONYMOUS_USER:
login_maybe_required = lambda func: func
Variable | \nValue | \n
---|---|
args | \n() | \n
kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
view | \n<function api_view.<locals>.view at 0x7f5819fba790> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/views/decorators/cache.py
in _cache_controlled
\n\n \n )
def cache_control(**kwargs):
def _cache_controller(viewfunc):
@wraps(viewfunc)
def _cache_controlled(request, *args, **kw):
response = viewfunc(request, *args, **kw)…
patch_cache_control(response, **kwargs)
return response
return _cache_controlled
return _cache_controller
Variable | \nValue | \n
---|---|
args | \n() | \n
kw | \n{'id': '6', 'model': 'collectingevent'} | \n
kwargs | \n{'max_age': 2, 'private': True} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
viewfunc | \n<function api_view.<locals>.view at 0x7f5819fba700> | \n
/opt/specify7/specifyweb/specify/views.py
in view
\n\n \n @cache_control(private=True, max_age=2)
def view(request, *args, **kwargs):
"""RESTful API endpoint for most Specify datamodel resources.
<model> is the table from the Specify datamodel. <id> is the
row id.
"""
try:
return dispatch_func(request, *args, **kwargs)…
except api.StaleObjectException as e:
return HttpResponseConflict(e)
except api.MissingVersionException as e:
return http.HttpResponseBadRequest(e)
except http.Http404 as e:
return http.HttpResponseNotFound(e)
Variable | \nValue | \n
---|---|
args | \n() | \n
dispatch_func | \n<function resource_dispatch at 0x7f581a45b5e0> | \n
kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
/opt/specify7/specifyweb/specify/api.py
in resource_dispatch
\n\n \n data = json.load(request)
# Look for a version field in the resource data itself.
try:
version = data['version']
except KeyError:
pass
obj = put_resource(request.specify_collection,…
request.specify_user_agent,
model, id, version, data)
resp = HttpResponse(toJson(_obj_to_data(obj, checker)),
content_type='application/json')
Variable | \nValue | \n
---|---|
checker | \n<function table_permissions_checker.<locals>.checker at 0x7f581712f790> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \n
id | \n'6' | \n
model | \n'collectingevent' | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
request_params | \n<QueryDict: {}> | \n
version | \n2 | \n
/usr/lib/python3.8/contextlib.py
in inner
\n\n \n """
return self
def __call__(self, func):
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
return func(*args, **kwds)…
return inner
class _GeneratorContextManagerBase:
"""Shared functionality for @contextmanager and @asynccontextmanager."""
Variable | \nValue | \n
---|---|
args | \n(<SimpleLazyObject: <Collection: Collection object (4)>>,\n <SimpleLazyObject: <Agent: Agent object (1514)>>,\n 'collectingevent',\n '6',\n 2,\n {'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n… <trimmed 5976 bytes string> | \n
func | \n<function put_resource at 0x7f581a463430> | \n
kwds | \n{} | \n
self | \n<django.db.transaction.Atomic object at 0x7f581a461670> | \n
/opt/specify7/specifyweb/specify/api.py
in put_resource
\n\n \n for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
@transaction.atomic
def put_resource(collection, agent, name: str, id, version, data: Dict[str, Any]):
return update_obj(collection, agent, name, id, version, data)…
def update_obj(collection, agent, name: str, id, version, data: Dict[str, Any], parent_obj=None):
"""Update the resource with 'id' in model named 'name' with given
'data'.
"""
obj = get_object_or_404(name, id=int(id))
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \n
id | \n'6' | \n
name | \n'collectingevent' | \n
version | \n2 | \n
/opt/specify7/specifyweb/specify/api.py
in update_obj
\n\n \n obj.modifiedbyagent = agent
bump_version(obj, version)
obj.save(force_update=True)
auditlog.update(obj, agent, parent_obj, dirty)
for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
handle_to_many(collection, agent, obj, data)…
return obj
def bump_version(obj, version) -> None:
"""Implements the optimistic locking mechanism.
If the Django model resource 'obj' has a version field and it
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \n
dependents_to_delete | \n[] | \n
dirty | \n[] | \n
fk_dirty | \n[] | \n
id | \n'6' | \n
name | \n'collectingevent' | \n
obj | \n<Collectingevent: Collectingevent object (6)> | \n
parent_obj | \nNone | \n
version | \n2 | \n
/opt/specify7/specifyweb/specify/api.py
in handle_to_many
\n\n \n # Update an existing related object.
rel_obj = update_obj(collection, agent,
rel_model, rel_data['id'],
rel_data['version'], rel_data,
parent_obj=obj)
else:
# Create a new related object.
rel_obj = create_obj(collection, agent, rel_model, rel_data, parent_obj=obj)…
ids.append(rel_obj.id) # Record the id as one to keep.
# Delete related objects not in the ids list.
# TODO: Check versions for optimistic locking.
to_delete = getattr(obj, field_name).exclude(id__in=ids)
for rel_obj in to_delete:
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \n
field | \n<ManyToOneRel: specify.collector> | \n
field_name | \n'collectors' | \n
ids | \n[14028, 15627, 14191, 13629, 12523] | \n
obj | \n<Collectingevent: Collectingevent object (6)> | \n
rel_data | \n{'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None} | \n
rel_model | \n<class 'specifyweb.specify.models.Collector'> | \n
rel_obj | \n<Collector: Collector object (12523)> | \n
to_delete | \n<QuerySet []> | \n
val | \n[{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:50:06',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None}] | \n
/opt/specify7/specifyweb/specify/api.py
in create_obj
\n\n \n data = cleanData(model, data, agent)
obj = model()
handle_fk_fields(collection, agent, obj, data)
set_fields_from_data(obj, data)
set_field_if_exists(obj, 'createdbyagent', agent)
set_field_if_exists(obj, 'collectionmemberid', collection.id)
try:
autonumber_and_save(collection, agent.specifyuser, obj)…
except AutonumberOverflowException as e:
logger.warn("autonumbering overflow: %s", e)
if obj.id is not None: # was the object actually saved?
check_table_permissions(collection, agent, obj, "create")
auditlog.insert(obj, agent, parent_obj)
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None} | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
obj | \n<Collector: Collector object (None)> | \n
parent_obj | \n<Collectingevent: Collectingevent object (6)> | \n
/opt/specify7/specifyweb/specify/autonumbering.py
in autonumber_and_save
\n\n \n for vals in [formatter.parse(value)]
if formatter.needs_autonumber(vals)]
if len(autonumber_fields) > 0:
do_autonumbering(collection, obj, autonumber_fields)
else:
logger.debug("no fields to autonumber for %s", obj)
obj.save()…
def do_autonumbering(collection, obj, fields: List[Tuple[UIFormatter, Sequence[str]]]) -> None:
logger.debug("autonumbering %s fields: %s", obj, fields)
# The autonumber action is prepared and thunked outside the locked table
# context since it looks at other tables and that is not allowed by mysql
Variable | \nValue | \n
---|---|
autonumber_fields | \n[] | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
obj | \n<Collector: Collector object (None)> | \n
uiformatters | \n[] | \n
user | \n<Specifyuser: Specifyuser object (2)> | \n
/opt/specify7/specifyweb/specify/build_models.py
in save
\n\n \n if table.django_name in orderings:
ordering += orderings[table.django_name]
if 'rankid' in attrs:
ordering += ('rankid', )
def save(self, *args, **kwargs):
try:
return super(model, self).save(*args, **kwargs)…
except AbortSave:
return
attrs['save'] = save
attrs['Meta'] = Meta
Variable | \nValue | \n
---|---|
args | \n() | \n
kwargs | \n{} | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
self | \n<Collector: Collector object (None)> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save
\n\n \n for field in self._meta.concrete_fields:
if not field.primary_key and not hasattr(field, 'through'):
field_names.add(field.attname)
loaded_fields = field_names.difference(deferred_fields)
if loaded_fields:
update_fields = frozenset(loaded_fields)
self.save_base(using=using, force_insert=force_insert,…
force_update=force_update, update_fields=update_fields)
save.alters_data = True
def save_base(self, raw=False, force_insert=False,
force_update=False, using=None, update_fields=None):
"""
Variable | \nValue | \n
---|---|
deferred_fields | \nset() | \n
field | \n<django.db.models.fields.related.ForeignKey: modifiedbyagent> | \n
force_insert | \nFalse | \n
force_update | \nFalse | \n
obj | \n<Division: Division object (2)> | \n
self | \n<Collector: Collector object (None)> | \n
update_fields | \nNone | \n
using | \n'default' | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save_base
\n\n \n assert update_fields is None or update_fields
cls = origin = self.__class__
# Skip proxies, but keep the origin as the proxy model.
if cls._meta.proxy:
cls = cls._meta.concrete_model
meta = cls._meta
if not meta.auto_created:
pre_save.send(…
sender=origin, instance=self, raw=raw, using=using,
update_fields=update_fields,
)
# A transaction isn't needed if one query is issued.
if meta.parents:
context_manager = transaction.atomic(using=using, savepoint=False)
Variable | \nValue | \n
---|---|
cls | \n<class 'specifyweb.specify.models.Collector'> | \n
force_insert | \nFalse | \n
force_update | \nFalse | \n
meta | \n<Options for Collector> | \n
origin | \n<class 'specifyweb.specify.models.Collector'> | \n
raw | \nFalse | \n
self | \n<Collector: Collector object (None)> | \n
update_fields | \nNone | \n
using | \n'default' | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in send
\n\n \n Named arguments which will be passed to receivers.
Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return […
(receiver, receiver(signal=self, sender=sender, **named))
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Variable | \nValue | \n
---|---|
named | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'update_fields': None,\n 'using': 'default'} | \n
self | \n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in <listcomp>
\n\n \n Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return [
(receiver, receiver(signal=self, sender=sender, **named))…
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Send signal from sender to all connected receivers catching errors.
Variable | \nValue | \n
---|---|
.0 | \n<list_iterator object at 0x7f5815dc5910> | \n
named | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'update_fields': None,\n 'using': 'default'} | \n
receiver | \n<function orm_signal_handler.<locals>._dec.<locals>.handler at 0x7f581a5bfc10> | \n
self | \n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/specifyweb/businessrules/orm_signal_handler.py
in handler
\n\n \n receiver_kwargs = {}
if model is not None:
receiver_kwargs['sender'] = getattr(models, model)
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
# since the rule knows what model the signal comes from
# the sender value is redundant.
rule(kwargs['instance'])…
else:
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
rule(sender, kwargs['instance'])
return receiver(getattr(signals, signal), **receiver_kwargs)(handler)
Variable | \nValue | \n
---|---|
kwargs | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'signal': <django.db.models.signals.ModelSignal object at 0x7f581ed6e730>,\n 'update_fields': None,\n 'using': 'default'} | \n
rule | \n<function make_uniqueness_rule.<locals>.check_unique at 0x7f581a5bf940> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/specifyweb/businessrules/uniqueness_rules.py
in check_unique
\n\n \n if value is None: return
conflicts = model.objects.only('id').filter(**{
parent_field + '_id': parent,
unique_field: value})
if instance.id is not None:
conflicts = conflicts.exclude(id=instance.id)
if conflicts:
raise BusinessRuleException(…
"{} must have unique {} in {}".format(table_name, unique_field, parent_field),
{"table" : table_name,
"localizationKey" : "childFieldNotUnique",
"fieldName" : unique_field,
"fieldData" : (unique_field, serialize_django_obj(value)),
"parentField" : parent_field,
Variable | \nValue | \n
---|---|
conflicts | \n<QuerySet [<Collector: Collector object (2500)>]> | \n
instance | \n<Collector: Collector object (None)> | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
parent | \n6 | \n
parent_field | \n'collectingevent' | \n
table_name | \n'Collector' | \n
unique_field | \n'agent' | \n
value | \n<Agent: Agent object (626)> | \n
Specifyuser object (2)
\n \n\nNo GET data
\n \n\nNo POST data
\n \nNo FILES data
\n \n\n\nVariable | \nValue | \n
---|---|
csrftoken | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
collection | \n'4' | \n
sessionid | \n'j9ticyfverpw08kowuq6shl07psrvmdv' | \n
Variable | \nValue | \n
---|---|
CONTENT_LENGTH | \n'3750' | \n
CONTENT_TYPE | \n'application/json' | \n
CSRF_COOKIE | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
HTTP_ACCEPT | \n'application/json' | \n
HTTP_ACCEPT_ENCODING | \n'gzip, deflate, br' | \n
HTTP_ACCEPT_LANGUAGE | \n'en-US,en;q=0.5' | \n
HTTP_CONNECTION | \n'close' | \n
HTTP_COOKIE | \n('csrftoken=YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m; '\n 'collection=4; sessionid=j9ticyfverpw08kowuq6shl07psrvmdv') | \n
HTTP_HOST | \n'coldfish-issue-2808.test.specifysystems.org' | \n
HTTP_ORIGIN | \n'https://coldfish-issue-2808.test.specifysystems.org' | \n
HTTP_REFERER | \n'https://coldfish-issue-2808.test.specifysystems.org/specify/view/collectingevent/6/?recordsetid=132' | \n
HTTP_SEC_FETCH_DEST | \n'empty' | \n
HTTP_SEC_FETCH_MODE | \n'cors' | \n
HTTP_SEC_FETCH_SITE | \n'same-origin' | \n
HTTP_USER_AGENT | \n('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 '\n 'Firefox/110.0') | \n
HTTP_X_CSRFTOKEN | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
HTTP_X_FORWARDED_FOR | \n'129.237.90.147' | \n
HTTP_X_REAL_IP | \n'129.237.90.147' | \n
PATH_INFO | \n'/api/specify/collectingevent/6/' | \n
QUERY_STRING | \n'' | \n
RAW_URI | \n'/api/specify/collectingevent/6/' | \n
REMOTE_ADDR | \n'172.20.0.10' | \n
REMOTE_PORT | \n'40772' | \n
REQUEST_METHOD | \n'PUT' | \n
SCRIPT_NAME | \n'' | \n
SERVER_NAME | \n'0.0.0.0' | \n
SERVER_PORT | \n'8000' | \n
SERVER_PROTOCOL | \n'HTTP/1.0' | \n
SERVER_SOFTWARE | \n'gunicorn/20.1.0' | \n
gunicorn.socket | \n<socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.20.0.24', 8000), raddr=('172.20.0.10', 40772)> | \n
wsgi.errors | \n<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f5815dd8fd0> | \n
wsgi.file_wrapper | \n'' | \n
wsgi.input | \n<gunicorn.http.body.Body object at 0x7f5815dcf3a0> | \n
wsgi.input_terminated | \nTrue | \n
wsgi.multiprocess | \nTrue | \n
wsgi.multithread | \nFalse | \n
wsgi.run_once | \nFalse | \n
wsgi.url_scheme | \n'http' | \n
wsgi.version | \n(1, 0) | \n
settings
Setting | \nValue | \n
---|---|
ABSOLUTE_URL_OVERRIDES | \n{} | \n
ADMINS | \n() | \n
ADMIN_MEDIA_PREFIX | \n'/static/admin/' | \n
ALLOWED_HOSTS | \n['*'] | \n
ALLOW_SPECIFY6_PASSWORDS | \n'********************' | \n
ALLOW_SUPPORT_LOGIN | \nFalse | \n
ANONYMOUS_USER | \nNone | \n
APPEND_SLASH | \nTrue | \n
AUTHENTICATION_BACKENDS | \n['django.contrib.auth.backends.ModelBackend'] | \n
AUTH_LDAP_SERVER_URI | \nNone | \n
AUTH_PASSWORD_VALIDATORS | \n'********************' | \n
AUTH_USER_MODEL | \n'specify.Specifyuser' | \n
CACHES | \n{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} | \n
CACHE_MIDDLEWARE_ALIAS | \n'default' | \n
CACHE_MIDDLEWARE_KEY_PREFIX | \n'********************' | \n
CACHE_MIDDLEWARE_SECONDS | \n600 | \n
CELERY_BROKER_URL | \n'redis://redis/0' | \n
CELERY_RESULT_BACKEND | \n'redis://redis/1' | \n
CELERY_TASK_DEFAULT_QUEUE | \n'coldfish-issue-2808' | \n
CSRF_COOKIE_AGE | \n31449600 | \n
CSRF_COOKIE_DOMAIN | \nNone | \n
CSRF_COOKIE_HTTPONLY | \nFalse | \n
CSRF_COOKIE_NAME | \n'csrftoken' | \n
CSRF_COOKIE_PATH | \n'/' | \n
CSRF_COOKIE_SAMESITE | \n'Lax' | \n
CSRF_COOKIE_SECURE | \nFalse | \n
CSRF_FAILURE_VIEW | \n'django.views.csrf.csrf_failure' | \n
CSRF_HEADER_NAME | \n'HTTP_X_CSRFTOKEN' | \n
CSRF_TRUSTED_ORIGINS | \n[] | \n
CSRF_USE_SESSIONS | \nFalse | \n
DATABASES | \n{'default': {'ATOMIC_REQUESTS': False,\n 'AUTOCOMMIT': True,\n 'CONN_MAX_AGE': 0,\n 'ENGINE': 'specifyweb.hibernateboolsbackend.backends.mysql',\n 'HOST': 'mariadb',\n 'NAME': 'coldFish',\n 'OPTIONS': {},\n 'PASSWORD': '********************',\n 'PORT': '',\n 'TEST': {'CHARSET': None,\n 'COLLATION': None,\n 'MIRROR': None,\n 'NAME': None},\n 'TIME_ZONE': None,\n 'USER': 'root'}} | \n
DATABASE_HOST | \n'mariadb' | \n
DATABASE_NAME | \n'coldFish' | \n
DATABASE_OPTIONS | \n{} | \n
DATABASE_PORT | \n'' | \n
DATABASE_ROUTERS | \n[] | \n
DATA_UPLOAD_MAX_MEMORY_SIZE | \n419430400 | \n
DATA_UPLOAD_MAX_NUMBER_FIELDS | \n1000 | \n
DATETIME_FORMAT | \n'N j, Y, P' | \n
DATETIME_INPUT_FORMATS | \n['%Y-%m-%d %H:%M:%S',\n '%Y-%m-%d %H:%M:%S.%f',\n '%Y-%m-%d %H:%M',\n '%Y-%m-%d',\n '%m/%d/%Y %H:%M:%S',\n '%m/%d/%Y %H:%M:%S.%f',\n '%m/%d/%Y %H:%M',\n '%m/%d/%Y',\n '%m/%d/%y %H:%M:%S',\n '%m/%d/%y %H:%M:%S.%f',\n '%m/%d/%y %H:%M',\n '%m/%d/%y'] | \n
DATE_FORMAT | \n'N j, Y' | \n
DATE_INPUT_FORMATS | \n['%Y-%m-%d',\n '%m/%d/%Y',\n '%m/%d/%y',\n '%b %d %Y',\n '%b %d, %Y',\n '%d %b %Y',\n '%d %b, %Y',\n '%B %d %Y',\n '%B %d, %Y',\n '%d %B %Y',\n '%d %B, %Y'] | \n
DEBUG | \nTrue | \n
DEBUG_PROPAGATE_EXCEPTIONS | \nFalse | \n
DECIMAL_SEPARATOR | \n'.' | \n
DEFAULT_CHARSET | \n'utf-8' | \n
DEFAULT_CONTENT_TYPE | \n'text/html' | \n
DEFAULT_EXCEPTION_REPORTER_FILTER | \n'django.views.debug.SafeExceptionReporterFilter' | \n
DEFAULT_FILE_STORAGE | \n'django.core.files.storage.FileSystemStorage' | \n
DEFAULT_FROM_EMAIL | \n'webmaster@localhost' | \n
DEFAULT_INDEX_TABLESPACE | \n'' | \n
DEFAULT_TABLESPACE | \n'' | \n
DEPOSITORY_DIR | \n'/volumes/static-files/depository' | \n
DISABLE_AUDITING | \nFalse | \n
DISALLOWED_USER_AGENTS | \n[] | \n
EMAIL_BACKEND | \n'django.core.mail.backends.smtp.EmailBackend' | \n
EMAIL_HOST | \n'localhost' | \n
EMAIL_HOST_PASSWORD | \n'********************' | \n
EMAIL_HOST_USER | \n'' | \n
EMAIL_PORT | \n25 | \n
EMAIL_SSL_CERTFILE | \nNone | \n
EMAIL_SSL_KEYFILE | \n'********************' | \n
EMAIL_SUBJECT_PREFIX | \n'[Django] ' | \n
EMAIL_TIMEOUT | \nNone | \n
EMAIL_USE_LOCALTIME | \nFalse | \n
EMAIL_USE_SSL | \nFalse | \n
EMAIL_USE_TLS | \nFalse | \n
FILE_CHARSET | \n'utf-8' | \n
FILE_UPLOAD_DIRECTORY_PERMISSIONS | \nNone | \n
FILE_UPLOAD_HANDLERS | \n['django.core.files.uploadhandler.MemoryFileUploadHandler',\n 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] | \n
FILE_UPLOAD_MAX_MEMORY_SIZE | \n104857600 | \n
FILE_UPLOAD_PERMISSIONS | \nNone | \n
FILE_UPLOAD_TEMP_DIR | \nNone | \n
FIRST_DAY_OF_WEEK | \n0 | \n
FIXTURE_DIRS | \n[] | \n
FORCE_SCRIPT_NAME | \nNone | \n
FORMAT_MODULE_PATH | \nNone | \n
FORM_RENDERER | \n'django.forms.renderers.DjangoTemplates' | \n
IGNORABLE_404_URLS | \n[] | \n
INSTALLED_APPS | \n('django.contrib.sessions',\n 'django.contrib.staticfiles',\n 'django.contrib.contenttypes',\n 'django.contrib.auth',\n 'specifyweb.specify',\n 'specifyweb.permissions',\n 'specifyweb.accounts',\n 'specifyweb.stored_queries',\n 'specifyweb.businessrules',\n 'specifyweb.express_search',\n 'specifyweb.context',\n 'specifyweb.attachment_gw',\n 'specifyweb.frontend',\n 'specifyweb.barvis',\n 'specifyweb.report_runner',\n 'specifyweb.interactions',\n 'specifyweb.workbench',\n 'specifyweb.notifications',\n 'specifyweb.export',\n 'specifyweb.raven_placeholder',\n 'django_jsonfield_backport') | \n
INTERNAL_IPS | \n[] | \n
JAVA_PATH | \n'/usr/bin/java' | \n
LANGUAGES | \n[('en-us', 'English'),\n ('ru-ru', 'русский'),\n ('uk-ua', 'українська'),\n ('fr-fr', 'français'),\n ('es-es', 'español')] | \n
LANGUAGES_BIDI | \n['he', 'ar', 'fa', 'ur'] | \n
LANGUAGE_CODE | \n'en-us' | \n
LANGUAGE_COOKIE_AGE | \nNone | \n
LANGUAGE_COOKIE_DOMAIN | \nNone | \n
LANGUAGE_COOKIE_NAME | \n'language' | \n
LANGUAGE_COOKIE_PATH | \n'/' | \n
LOCALE_PATHS | \n('/opt/specify7/frontend/locale',) | \n
LOGGING | \n{'disable_existing_loggers': False,\n 'formatters': {'standard': {'datefmt': '%d/%b/%Y %H:%M:%S',\n 'format': '[%(asctime)s] [%(levelname)s] '\n '[%(name)s:%(lineno)s] %(message)s'}},\n 'handlers': {'console': {'class': 'logging.StreamHandler',\n 'formatter': 'standard',\n 'level': 'DEBUG'}},\n 'loggers': {'django.request': {'handlers': ['console'],\n 'level': 'DEBUG',\n 'propagate': False},\n 'specifyweb': {'handlers': ['console'],\n 'level': 'DEBUG',\n 'propagate': False}},\n 'version': 1} | \n
LOGGING_CONFIG | \n'logging.config.dictConfig' | \n
LOGIN_REDIRECT_URL | \n'/' | \n
LOGIN_URL | \n'/accounts/login/' | \n
LOGOUT_REDIRECT_URL | \nNone | \n
MANAGERS | \n() | \n
MASTER_NAME | \n'root' | \n
MASTER_PASSWORD | \n'********************' | \n
MEDIA_ROOT | \n'' | \n
MEDIA_URL | \n'' | \n
MESSAGE_STORAGE | \n'django.contrib.messages.storage.fallback.FallbackStorage' | \n
MIDDLEWARE | \n['django.middleware.gzip.GZipMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.locale.LocaleMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'specifyweb.context.middleware.ContextMiddleware',\n 'specifyweb.permissions.middleware.PermissionsMiddleware',\n 'specifyweb.middleware.general.GeneralMiddleware'] | \n
MIGRATION_MODULES | \n{} | \n
MONTH_DAY_FORMAT | \n'F j' | \n
NOTIFICATION_TTL_DAYS | \n7 | \n
NUMBER_GROUPING | \n0 | \n
OAUTH_LOGIN_PROVIDERS | \n{} | \n
PASSWORD_HASHERS | \n'********************' | \n
PASSWORD_RESET_TIMEOUT_DAYS | \n'********************' | \n
PREPEND_WWW | \nFalse | \n
RAVEN_CONFIG | \nNone | \n
REPORT_RUNNER_HOST | \n'report-runner' | \n
REPORT_RUNNER_PORT | \n'8080' | \n
ROOT_URLCONF | \n'specifyweb.urls' | \n
RO_MODE | \nFalse | \n
SA_DATABASE_URL | \n'mysql://root:root@mariadb:3306/coldFish?charset=utf8' | \n
SA_POOL_RECYCLE | \n3600 | \n
SECRET_KEY | \n'********************' | \n
SECURE_BROWSER_XSS_FILTER | \nFalse | \n
SECURE_CONTENT_TYPE_NOSNIFF | \nFalse | \n
SECURE_HSTS_INCLUDE_SUBDOMAINS | \nFalse | \n
SECURE_HSTS_PRELOAD | \nFalse | \n
SECURE_HSTS_SECONDS | \n0 | \n
SECURE_PROXY_SSL_HEADER | \nNone | \n
SECURE_REDIRECT_EXEMPT | \n[] | \n
SECURE_SSL_HOST | \nNone | \n
SECURE_SSL_REDIRECT | \nFalse | \n
SEPARATE_WEB_ATTACHMENT_FOLDERS | \nNone | \n
SERVER_EMAIL | \n'root@localhost' | \n
SESSION_CACHE_ALIAS | \n'default' | \n
SESSION_COOKIE_AGE | \n1209600 | \n
SESSION_COOKIE_DOMAIN | \nNone | \n
SESSION_COOKIE_HTTPONLY | \nTrue | \n
SESSION_COOKIE_NAME | \n'sessionid' | \n
SESSION_COOKIE_PATH | \n'/' | \n
SESSION_COOKIE_SAMESITE | \n'Lax' | \n
SESSION_COOKIE_SECURE | \nFalse | \n
SESSION_ENGINE | \n'django.contrib.sessions.backends.file' | \n
SESSION_EXPIRE_AT_BROWSER_CLOSE | \nTrue | \n
SESSION_FILE_PATH | \nNone | \n
SESSION_SAVE_EVERY_REQUEST | \nFalse | \n
SESSION_SERIALIZER | \n'django.contrib.sessions.serializers.JSONSerializer' | \n
SETTINGS_MODULE | \n'settings' | \n
SHORT_DATETIME_FORMAT | \n'm/d/Y P' | \n
SHORT_DATE_FORMAT | \n'm/d/Y' | \n
SIGNING_BACKEND | \n'django.core.signing.TimestampSigner' | \n
SILENCED_SYSTEM_CHECKS | \n[] | \n
SITE_ID | \n1 | \n
SPECIFY_CONFIG_DIR | \n'/opt/Specify/config' | \n
SPECIFY_THICK_CLIENT | \n'/opt/Specify' | \n
STATICFILES_DIRS | \n(('config', '/opt/Specify/config'),) | \n
STATICFILES_FINDERS | \n('django.contrib.staticfiles.finders.FileSystemFinder',\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder') | \n
STATICFILES_STORAGE | \n'django.contrib.staticfiles.storage.StaticFilesStorage' | \n
STATIC_ROOT | \n'' | \n
STATIC_URL | \n'/static/' | \n
STATS_URL | \n'https://stats.specifycloud.org/capture' | \n
SUPPORT_LOGIN_TTL | \n300 | \n
TEMPLATES | \n[{'APP_DIRS': True,\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\n 'DIRS': [],\n 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth',\n 'django.template.context_processors.debug',\n 'django.template.context_processors.i18n',\n 'django.template.context_processors.media',\n 'django.template.context_processors.static',\n 'django.template.context_processors.tz',\n 'django.contrib.messages.context_processors.messages',\n 'django.template.context_processors.request']}}] | \n
TEST_NON_SERIALIZED_APPS | \n[] | \n
TEST_RUNNER | \n'django.test.runner.DiscoverRunner' | \n
THICK_CLIENT_LOCATION | \n'/opt/Specify' | \n
THOUSAND_SEPARATOR | \n',' | \n
TIME_FORMAT | \n'P' | \n
TIME_INPUT_FORMATS | \n['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] | \n
TIME_ZONE | \n'America/Chicago' | \n
USE_I18N | \nTrue | \n
USE_L10N | \nTrue | \n
USE_THOUSAND_SEPARATOR | \nFalse | \n
USE_TZ | \nFalse | \n
USE_X_FORWARDED_HOST | \nFalse | \n
USE_X_FORWARDED_PORT | \nFalse | \n
VERSION | \n'issue-2808(debug)' | \n
WB_UPLOAD_LOG_DIR | \n'/home/specify/wb_upload_logs' | \n
WEBPACK_LOADER | \n{'MANIFEST_FILE': '/static/manifest.json'} | \n
WEB_ATTACHMENT_COLLECTION | \n'sp7demofish' | \n
WEB_ATTACHMENT_KEY | \n'********************' | \n
WEB_ATTACHMENT_REQUIRES_KEY_FOR_GET | \n'********************' | \n
WEB_ATTACHMENT_URL | \n'https://demo-assets.specifycloud.org/web_asset_store.xml' | \n
WSGI_APPLICATION | \nNone | \n
X_FRAME_OPTIONS | \n'SAMEORIGIN' | \n
YEAR_MONTH_FORMAT | \n'F Y' | \n
\n You're seeing this error because you have DEBUG = True
in your\n Django settings file. Change that to False
, and Django will\n display a standard page generated by the handler for this status code.\n
('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]})\n
Request Method: | \nPUT | \n
---|---|
Request URL: | \nhttp://coldfish-issue-2808.test.specifysystems.org/api/specify/collectingevent/6/ | \n
Django Version: | \n2.2.10 | \n
Exception Type: | \nBusinessRuleException | \n
Exception Value: | \n('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \n
Exception Location: | \n/opt/specify7/specifyweb/businessrules/uniqueness_rules.py in check_unique, line 45 | \n
Python Executable: | \n/opt/specify7/ve/bin/python3.8 | \n
Python Version: | \n3.8.0 | \n
Python Path: | \n['/opt/specify7',\n '/opt/specify7',\n '/opt/specify7/ve/bin',\n '/usr/lib/python38.zip',\n '/usr/lib/python3.8',\n '/usr/lib/python3.8/lib-dynload',\n '/opt/specify7/ve/lib/python3.8/site-packages',\n '/opt/specify7'] | \n
Server time: | \nMon, 13 Feb 2023 14:51:04 -0600 | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/exception.py
in inner
\n\n \n This decorator is automatically applied to all middleware to ensure that
no middleware leaks an exception and that the next middleware in the stack
can rely on getting a response instead of an exception.
"""
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | \nValue | \n
---|---|
exc | \nBusinessRuleException('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \n
get_response | \n<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\n\n \n break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)
except Exception as e:
response = self.process_exception_by_middleware(e, request)…
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
view_name = callback.__name__
else: # CBV
Variable | \nValue | \n
---|---|
callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
callback_args | \n() | \n
callback_kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
middleware_method | \n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
resolver | \n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \n
resolver_match | \nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\w+)/(?P<id>\\d+)/$) | \n
response | \nNone | \n
self | \n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \n
wrapped_callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\n\n \n response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
Variable | \nValue | \n
---|---|
callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
callback_args | \n() | \n
callback_kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
middleware_method | \n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
resolver | \n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \n
resolver_match | \nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\w+)/(?P<id>\\d+)/$) | \n
response | \nNone | \n
self | \n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \n
wrapped_callback | \n<function api_view.<locals>.view at 0x7f5819fba670> | \n
/opt/specify7/specifyweb/specify/views.py
in wrapped
\n\n \n from .specify_jar import specify_jar
def login_maybe_required(view):
@wraps(view)
def wrapped(request, *args, **kwargs):
if not request.user.is_authenticated:
return http.HttpResponseForbidden()
return view(request, *args, **kwargs)…
return wrapped
if settings.ANONYMOUS_USER:
login_maybe_required = lambda func: func
Variable | \nValue | \n
---|---|
args | \n() | \n
kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
view | \n<function api_view.<locals>.view at 0x7f5819fba790> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/views/decorators/cache.py
in _cache_controlled
\n\n \n )
def cache_control(**kwargs):
def _cache_controller(viewfunc):
@wraps(viewfunc)
def _cache_controlled(request, *args, **kw):
response = viewfunc(request, *args, **kw)…
patch_cache_control(response, **kwargs)
return response
return _cache_controlled
return _cache_controller
Variable | \nValue | \n
---|---|
args | \n() | \n
kw | \n{'id': '6', 'model': 'collectingevent'} | \n
kwargs | \n{'max_age': 2, 'private': True} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
viewfunc | \n<function api_view.<locals>.view at 0x7f5819fba700> | \n
/opt/specify7/specifyweb/specify/views.py
in view
\n\n \n @cache_control(private=True, max_age=2)
def view(request, *args, **kwargs):
"""RESTful API endpoint for most Specify datamodel resources.
<model> is the table from the Specify datamodel. <id> is the
row id.
"""
try:
return dispatch_func(request, *args, **kwargs)…
except api.StaleObjectException as e:
return HttpResponseConflict(e)
except api.MissingVersionException as e:
return http.HttpResponseBadRequest(e)
except http.Http404 as e:
return http.HttpResponseNotFound(e)
Variable | \nValue | \n
---|---|
args | \n() | \n
dispatch_func | \n<function resource_dispatch at 0x7f581a45b5e0> | \n
kwargs | \n{'id': '6', 'model': 'collectingevent'} | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
/opt/specify7/specifyweb/specify/api.py
in resource_dispatch
\n\n \n data = json.load(request)
# Look for a version field in the resource data itself.
try:
version = data['version']
except KeyError:
pass
obj = put_resource(request.specify_collection,…
request.specify_user_agent,
model, id, version, data)
resp = HttpResponse(toJson(_obj_to_data(obj, checker)),
content_type='application/json')
Variable | \nValue | \n
---|---|
checker | \n<function table_permissions_checker.<locals>.checker at 0x7f581712f790> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \n
id | \n'6' | \n
model | \n'collectingevent' | \n
request | \n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \n
request_params | \n<QueryDict: {}> | \n
version | \n2 | \n
/usr/lib/python3.8/contextlib.py
in inner
\n\n \n """
return self
def __call__(self, func):
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
return func(*args, **kwds)…
return inner
class _GeneratorContextManagerBase:
"""Shared functionality for @contextmanager and @asynccontextmanager."""
Variable | \nValue | \n
---|---|
args | \n(<SimpleLazyObject: <Collection: Collection object (4)>>,\n <SimpleLazyObject: <Agent: Agent object (1514)>>,\n 'collectingevent',\n '6',\n 2,\n {'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n… <trimmed 5976 bytes string> | \n
func | \n<function put_resource at 0x7f581a463430> | \n
kwds | \n{} | \n
self | \n<django.db.transaction.Atomic object at 0x7f581a461670> | \n
/opt/specify7/specifyweb/specify/api.py
in put_resource
\n\n \n for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
@transaction.atomic
def put_resource(collection, agent, name: str, id, version, data: Dict[str, Any]):
return update_obj(collection, agent, name, id, version, data)…
def update_obj(collection, agent, name: str, id, version, data: Dict[str, Any], parent_obj=None):
"""Update the resource with 'id' in model named 'name' with given
'data'.
"""
obj = get_object_or_404(name, id=int(id))
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \n
id | \n'6' | \n
name | \n'collectingevent' | \n
version | \n2 | \n
/opt/specify7/specifyweb/specify/api.py
in update_obj
\n\n \n obj.modifiedbyagent = agent
bump_version(obj, version)
obj.save(force_update=True)
auditlog.update(obj, agent, parent_obj, dirty)
for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
handle_to_many(collection, agent, obj, data)…
return obj
def bump_version(obj, version) -> None:
"""Implements the optimistic locking mechanism.
If the Django model resource 'obj' has a version field and it
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \n
dependents_to_delete | \n[] | \n
dirty | \n[] | \n
fk_dirty | \n[] | \n
id | \n'6' | \n
name | \n'collectingevent' | \n
obj | \n<Collectingevent: Collectingevent object (6)> | \n
parent_obj | \nNone | \n
version | \n2 | \n
/opt/specify7/specifyweb/specify/api.py
in handle_to_many
\n\n \n # Update an existing related object.
rel_obj = update_obj(collection, agent,
rel_model, rel_data['id'],
rel_data['version'], rel_data,
parent_obj=obj)
else:
# Create a new related object.
rel_obj = create_obj(collection, agent, rel_model, rel_data, parent_obj=obj)…
ids.append(rel_obj.id) # Record the id as one to keep.
# Delete related objects not in the ids list.
# TODO: Check versions for optimistic locking.
to_delete = getattr(obj, field_name).exclude(id__in=ids)
for rel_obj in to_delete:
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'collectingeventattachments': [],\n 'collectingeventattribute': None,\n 'collectingeventattrs': [],\n 'collectingeventauthorizations': [],\n 'collectingtrip': None,\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\n 'collectors': [{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \n
field | \n<ManyToOneRel: specify.collector> | \n
field_name | \n'collectors' | \n
ids | \n[14028, 15627, 14191, 13629, 12523] | \n
obj | \n<Collectingevent: Collectingevent object (6)> | \n
rel_data | \n{'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None} | \n
rel_model | \n<class 'specifyweb.specify.models.Collector'> | \n
rel_obj | \n<Collector: Collector object (12523)> | \n
to_delete | \n<QuerySet []> | \n
val | \n[{'agent': '/api/specify/agent/2244/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14028,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 0,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14028/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:48:50',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/322/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 15627,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 2,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/15627/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:16',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/106/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 14191,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 3,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/14191/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:36',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/380/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 13629,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 4,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/13629/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:49:52',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/1637/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'createdbyagent': '/api/specify/agent/1986/',\n 'division': '/api/specify/division/2/',\n 'id': 12523,\n 'isprimary': True,\n 'modifiedbyagent': '/api/specify/agent/1514/',\n 'ordernumber': 5,\n 'remarks': None,\n 'resource_uri': '/api/specify/collector/12523/',\n 'text1': None,\n 'text2': None,\n 'timestampcreated': '2010-09-28T09:54:05',\n 'timestampmodified': '2010-09-28T09:50:06',\n 'version': 0,\n 'yesno1': None,\n 'yesno2': None},\n {'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None}] | \n
/opt/specify7/specifyweb/specify/api.py
in create_obj
\n\n \n data = cleanData(model, data, agent)
obj = model()
handle_fk_fields(collection, agent, obj, data)
set_fields_from_data(obj, data)
set_field_if_exists(obj, 'createdbyagent', agent)
set_field_if_exists(obj, 'collectionmemberid', collection.id)
try:
autonumber_and_save(collection, agent.specifyuser, obj)…
except AutonumberOverflowException as e:
logger.warn("autonumbering overflow: %s", e)
if obj.id is not None: # was the object actually saved?
check_table_permissions(collection, agent, obj, "create")
auditlog.insert(obj, agent, parent_obj)
Variable | \nValue | \n
---|---|
agent | \n<SimpleLazyObject: <Agent: Agent object (1514)>> | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
data | \n{'agent': '/api/specify/agent/626/',\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\n 'division': '/api/specify/division/2/',\n 'remarks': None} | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
obj | \n<Collector: Collector object (None)> | \n
parent_obj | \n<Collectingevent: Collectingevent object (6)> | \n
/opt/specify7/specifyweb/specify/autonumbering.py
in autonumber_and_save
\n\n \n for vals in [formatter.parse(value)]
if formatter.needs_autonumber(vals)]
if len(autonumber_fields) > 0:
do_autonumbering(collection, obj, autonumber_fields)
else:
logger.debug("no fields to autonumber for %s", obj)
obj.save()…
def do_autonumbering(collection, obj, fields: List[Tuple[UIFormatter, Sequence[str]]]) -> None:
logger.debug("autonumbering %s fields: %s", obj, fields)
# The autonumber action is prepared and thunked outside the locked table
# context since it looks at other tables and that is not allowed by mysql
Variable | \nValue | \n
---|---|
autonumber_fields | \n[] | \n
collection | \n<SimpleLazyObject: <Collection: Collection object (4)>> | \n
obj | \n<Collector: Collector object (None)> | \n
uiformatters | \n[] | \n
user | \n<Specifyuser: Specifyuser object (2)> | \n
/opt/specify7/specifyweb/specify/build_models.py
in save
\n\n \n if table.django_name in orderings:
ordering += orderings[table.django_name]
if 'rankid' in attrs:
ordering += ('rankid', )
def save(self, *args, **kwargs):
try:
return super(model, self).save(*args, **kwargs)…
except AbortSave:
return
attrs['save'] = save
attrs['Meta'] = Meta
Variable | \nValue | \n
---|---|
args | \n() | \n
kwargs | \n{} | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
self | \n<Collector: Collector object (None)> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save
\n\n \n for field in self._meta.concrete_fields:
if not field.primary_key and not hasattr(field, 'through'):
field_names.add(field.attname)
loaded_fields = field_names.difference(deferred_fields)
if loaded_fields:
update_fields = frozenset(loaded_fields)
self.save_base(using=using, force_insert=force_insert,…
force_update=force_update, update_fields=update_fields)
save.alters_data = True
def save_base(self, raw=False, force_insert=False,
force_update=False, using=None, update_fields=None):
"""
Variable | \nValue | \n
---|---|
deferred_fields | \nset() | \n
field | \n<django.db.models.fields.related.ForeignKey: modifiedbyagent> | \n
force_insert | \nFalse | \n
force_update | \nFalse | \n
obj | \n<Division: Division object (2)> | \n
self | \n<Collector: Collector object (None)> | \n
update_fields | \nNone | \n
using | \n'default' | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save_base
\n\n \n assert update_fields is None or update_fields
cls = origin = self.__class__
# Skip proxies, but keep the origin as the proxy model.
if cls._meta.proxy:
cls = cls._meta.concrete_model
meta = cls._meta
if not meta.auto_created:
pre_save.send(…
sender=origin, instance=self, raw=raw, using=using,
update_fields=update_fields,
)
# A transaction isn't needed if one query is issued.
if meta.parents:
context_manager = transaction.atomic(using=using, savepoint=False)
Variable | \nValue | \n
---|---|
cls | \n<class 'specifyweb.specify.models.Collector'> | \n
force_insert | \nFalse | \n
force_update | \nFalse | \n
meta | \n<Options for Collector> | \n
origin | \n<class 'specifyweb.specify.models.Collector'> | \n
raw | \nFalse | \n
self | \n<Collector: Collector object (None)> | \n
update_fields | \nNone | \n
using | \n'default' | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in send
\n\n \n Named arguments which will be passed to receivers.
Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return […
(receiver, receiver(signal=self, sender=sender, **named))
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Variable | \nValue | \n
---|---|
named | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'update_fields': None,\n 'using': 'default'} | \n
self | \n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in <listcomp>
\n\n \n Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return [
(receiver, receiver(signal=self, sender=sender, **named))…
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Send signal from sender to all connected receivers catching errors.
Variable | \nValue | \n
---|---|
.0 | \n<list_iterator object at 0x7f5815dc5910> | \n
named | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'update_fields': None,\n 'using': 'default'} | \n
receiver | \n<function orm_signal_handler.<locals>._dec.<locals>.handler at 0x7f581a5bfc10> | \n
self | \n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/specifyweb/businessrules/orm_signal_handler.py
in handler
\n\n \n receiver_kwargs = {}
if model is not None:
receiver_kwargs['sender'] = getattr(models, model)
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
# since the rule knows what model the signal comes from
# the sender value is redundant.
rule(kwargs['instance'])…
else:
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
rule(sender, kwargs['instance'])
return receiver(getattr(signals, signal), **receiver_kwargs)(handler)
Variable | \nValue | \n
---|---|
kwargs | \n{'instance': <Collector: Collector object (None)>,\n 'raw': False,\n 'signal': <django.db.models.signals.ModelSignal object at 0x7f581ed6e730>,\n 'update_fields': None,\n 'using': 'default'} | \n
rule | \n<function make_uniqueness_rule.<locals>.check_unique at 0x7f581a5bf940> | \n
sender | \n<class 'specifyweb.specify.models.Collector'> | \n
/opt/specify7/specifyweb/businessrules/uniqueness_rules.py
in check_unique
\n\n \n if value is None: return
conflicts = model.objects.only('id').filter(**{
parent_field + '_id': parent,
unique_field: value})
if instance.id is not None:
conflicts = conflicts.exclude(id=instance.id)
if conflicts:
raise BusinessRuleException(…
"{} must have unique {} in {}".format(table_name, unique_field, parent_field),
{"table" : table_name,
"localizationKey" : "childFieldNotUnique",
"fieldName" : unique_field,
"fieldData" : (unique_field, serialize_django_obj(value)),
"parentField" : parent_field,
Variable | \nValue | \n
---|---|
conflicts | \n<QuerySet [<Collector: Collector object (2500)>]> | \n
instance | \n<Collector: Collector object (None)> | \n
model | \n<class 'specifyweb.specify.models.Collector'> | \n
parent | \n6 | \n
parent_field | \n'collectingevent' | \n
table_name | \n'Collector' | \n
unique_field | \n'agent' | \n
value | \n<Agent: Agent object (626)> | \n
Specifyuser object (2)
\n \n\nNo GET data
\n \n\nNo POST data
\n \nNo FILES data
\n \n\n\nVariable | \nValue | \n
---|---|
csrftoken | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
collection | \n'4' | \n
sessionid | \n'j9ticyfverpw08kowuq6shl07psrvmdv' | \n
Variable | \nValue | \n
---|---|
CONTENT_LENGTH | \n'3750' | \n
CONTENT_TYPE | \n'application/json' | \n
CSRF_COOKIE | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
HTTP_ACCEPT | \n'application/json' | \n
HTTP_ACCEPT_ENCODING | \n'gzip, deflate, br' | \n
HTTP_ACCEPT_LANGUAGE | \n'en-US,en;q=0.5' | \n
HTTP_CONNECTION | \n'close' | \n
HTTP_COOKIE | \n('csrftoken=YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m; '\n 'collection=4; sessionid=j9ticyfverpw08kowuq6shl07psrvmdv') | \n
HTTP_HOST | \n'coldfish-issue-2808.test.specifysystems.org' | \n
HTTP_ORIGIN | \n'https://coldfish-issue-2808.test.specifysystems.org' | \n
HTTP_REFERER | \n'https://coldfish-issue-2808.test.specifysystems.org/specify/view/collectingevent/6/?recordsetid=132' | \n
HTTP_SEC_FETCH_DEST | \n'empty' | \n
HTTP_SEC_FETCH_MODE | \n'cors' | \n
HTTP_SEC_FETCH_SITE | \n'same-origin' | \n
HTTP_USER_AGENT | \n('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 '\n 'Firefox/110.0') | \n
HTTP_X_CSRFTOKEN | \n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \n
HTTP_X_FORWARDED_FOR | \n'129.237.90.147' | \n
HTTP_X_REAL_IP | \n'129.237.90.147' | \n
PATH_INFO | \n'/api/specify/collectingevent/6/' | \n
QUERY_STRING | \n'' | \n
RAW_URI | \n'/api/specify/collectingevent/6/' | \n
REMOTE_ADDR | \n'172.20.0.10' | \n
REMOTE_PORT | \n'40772' | \n
REQUEST_METHOD | \n'PUT' | \n
SCRIPT_NAME | \n'' | \n
SERVER_NAME | \n'0.0.0.0' | \n
SERVER_PORT | \n'8000' | \n
SERVER_PROTOCOL | \n'HTTP/1.0' | \n
SERVER_SOFTWARE | \n'gunicorn/20.1.0' | \n
gunicorn.socket | \n<socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.20.0.24', 8000), raddr=('172.20.0.10', 40772)> | \n
wsgi.errors | \n<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f5815dd8fd0> | \n
wsgi.file_wrapper | \n'' | \n
wsgi.input | \n<gunicorn.http.body.Body object at 0x7f5815dcf3a0> | \n
wsgi.input_terminated | \nTrue | \n
wsgi.multiprocess | \nTrue | \n
wsgi.multithread | \nFalse | \n
wsgi.run_once | \nFalse | \n
wsgi.url_scheme | \n'http' | \n
wsgi.version | \n(1, 0) | \n
settings
Setting | \nValue | \n
---|---|
ABSOLUTE_URL_OVERRIDES | \n{} | \n
ADMINS | \n() | \n
ADMIN_MEDIA_PREFIX | \n'/static/admin/' | \n
ALLOWED_HOSTS | \n['*'] | \n
ALLOW_SPECIFY6_PASSWORDS | \n'********************' | \n
ALLOW_SUPPORT_LOGIN | \nFalse | \n
ANONYMOUS_USER | \nNone | \n
APPEND_SLASH | \nTrue | \n
AUTHENTICATION_BACKENDS | \n['django.contrib.auth.backends.ModelBackend'] | \n
AUTH_LDAP_SERVER_URI | \nNone | \n
AUTH_PASSWORD_VALIDATORS | \n'********************' | \n
AUTH_USER_MODEL | \n'specify.Specifyuser' | \n
CACHES | \n{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} | \n
CACHE_MIDDLEWARE_ALIAS | \n'default' | \n
CACHE_MIDDLEWARE_KEY_PREFIX | \n'********************' | \n
CACHE_MIDDLEWARE_SECONDS | \n600 | \n
CELERY_BROKER_URL | \n'redis://redis/0' | \n
CELERY_RESULT_BACKEND | \n'redis://redis/1' | \n
CELERY_TASK_DEFAULT_QUEUE | \n'coldfish-issue-2808' | \n
CSRF_COOKIE_AGE | \n31449600 | \n
CSRF_COOKIE_DOMAIN | \nNone | \n
CSRF_COOKIE_HTTPONLY | \nFalse | \n
CSRF_COOKIE_NAME | \n'csrftoken' | \n
CSRF_COOKIE_PATH | \n'/' | \n
CSRF_COOKIE_SAMESITE | \n'Lax' | \n
CSRF_COOKIE_SECURE | \nFalse | \n
CSRF_FAILURE_VIEW | \n'django.views.csrf.csrf_failure' | \n
CSRF_HEADER_NAME | \n'HTTP_X_CSRFTOKEN' | \n
CSRF_TRUSTED_ORIGINS | \n[] | \n
CSRF_USE_SESSIONS | \nFalse | \n
DATABASES | \n{'default': {'ATOMIC_REQUESTS': False,\n 'AUTOCOMMIT': True,\n 'CONN_MAX_AGE': 0,\n 'ENGINE': 'specifyweb.hibernateboolsbackend.backends.mysql',\n 'HOST': 'mariadb',\n 'NAME': 'coldFish',\n 'OPTIONS': {},\n 'PASSWORD': '********************',\n 'PORT': '',\n 'TEST': {'CHARSET': None,\n 'COLLATION': None,\n 'MIRROR': None,\n 'NAME': None},\n 'TIME_ZONE': None,\n 'USER': 'root'}} | \n
DATABASE_HOST | \n'mariadb' | \n
DATABASE_NAME | \n'coldFish' | \n
DATABASE_OPTIONS | \n{} | \n
DATABASE_PORT | \n'' | \n
DATABASE_ROUTERS | \n[] | \n
DATA_UPLOAD_MAX_MEMORY_SIZE | \n419430400 | \n
DATA_UPLOAD_MAX_NUMBER_FIELDS | \n1000 | \n
DATETIME_FORMAT | \n'N j, Y, P' | \n
DATETIME_INPUT_FORMATS | \n['%Y-%m-%d %H:%M:%S',\n '%Y-%m-%d %H:%M:%S.%f',\n '%Y-%m-%d %H:%M',\n '%Y-%m-%d',\n '%m/%d/%Y %H:%M:%S',\n '%m/%d/%Y %H:%M:%S.%f',\n '%m/%d/%Y %H:%M',\n '%m/%d/%Y',\n '%m/%d/%y %H:%M:%S',\n '%m/%d/%y %H:%M:%S.%f',\n '%m/%d/%y %H:%M',\n '%m/%d/%y'] | \n
DATE_FORMAT | \n'N j, Y' | \n
DATE_INPUT_FORMATS | \n['%Y-%m-%d',\n '%m/%d/%Y',\n '%m/%d/%y',\n '%b %d %Y',\n '%b %d, %Y',\n '%d %b %Y',\n '%d %b, %Y',\n '%B %d %Y',\n '%B %d, %Y',\n '%d %B %Y',\n '%d %B, %Y'] | \n
DEBUG | \nTrue | \n
DEBUG_PROPAGATE_EXCEPTIONS | \nFalse | \n
DECIMAL_SEPARATOR | \n'.' | \n
DEFAULT_CHARSET | \n'utf-8' | \n
DEFAULT_CONTENT_TYPE | \n'text/html' | \n
DEFAULT_EXCEPTION_REPORTER_FILTER | \n'django.views.debug.SafeExceptionReporterFilter' | \n
DEFAULT_FILE_STORAGE | \n'django.core.files.storage.FileSystemStorage' | \n
DEFAULT_FROM_EMAIL | \n'webmaster@localhost' | \n
DEFAULT_INDEX_TABLESPACE | \n'' | \n
DEFAULT_TABLESPACE | \n'' | \n
DEPOSITORY_DIR | \n'/volumes/static-files/depository' | \n
DISABLE_AUDITING | \nFalse | \n
DISALLOWED_USER_AGENTS | \n[] | \n
EMAIL_BACKEND | \n'django.core.mail.backends.smtp.EmailBackend' | \n
EMAIL_HOST | \n'localhost' | \n
EMAIL_HOST_PASSWORD | \n'********************' | \n
EMAIL_HOST_USER | \n'' | \n
EMAIL_PORT | \n25 | \n
EMAIL_SSL_CERTFILE | \nNone | \n
EMAIL_SSL_KEYFILE | \n'********************' | \n
EMAIL_SUBJECT_PREFIX | \n'[Django] ' | \n
EMAIL_TIMEOUT | \nNone | \n
EMAIL_USE_LOCALTIME | \nFalse | \n
EMAIL_USE_SSL | \nFalse | \n
EMAIL_USE_TLS | \nFalse | \n
FILE_CHARSET | \n'utf-8' | \n
FILE_UPLOAD_DIRECTORY_PERMISSIONS | \nNone | \n
FILE_UPLOAD_HANDLERS | \n['django.core.files.uploadhandler.MemoryFileUploadHandler',\n 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] | \n
FILE_UPLOAD_MAX_MEMORY_SIZE | \n104857600 | \n
FILE_UPLOAD_PERMISSIONS | \nNone | \n
FILE_UPLOAD_TEMP_DIR | \nNone | \n
FIRST_DAY_OF_WEEK | \n0 | \n
FIXTURE_DIRS | \n[] | \n
FORCE_SCRIPT_NAME | \nNone | \n
FORMAT_MODULE_PATH | \nNone | \n
FORM_RENDERER | \n'django.forms.renderers.DjangoTemplates' | \n
IGNORABLE_404_URLS | \n[] | \n
INSTALLED_APPS | \n('django.contrib.sessions',\n 'django.contrib.staticfiles',\n 'django.contrib.contenttypes',\n 'django.contrib.auth',\n 'specifyweb.specify',\n 'specifyweb.permissions',\n 'specifyweb.accounts',\n 'specifyweb.stored_queries',\n 'specifyweb.businessrules',\n 'specifyweb.express_search',\n 'specifyweb.context',\n 'specifyweb.attachment_gw',\n 'specifyweb.frontend',\n 'specifyweb.barvis',\n 'specifyweb.report_runner',\n 'specifyweb.interactions',\n 'specifyweb.workbench',\n 'specifyweb.notifications',\n 'specifyweb.export',\n 'specifyweb.raven_placeholder',\n 'django_jsonfield_backport') | \n
INTERNAL_IPS | \n[] | \n
JAVA_PATH | \n'/usr/bin/java' | \n
LANGUAGES | \n[('en-us', 'English'),\n ('ru-ru', 'русский'),\n ('uk-ua', 'українська'),\n ('fr-fr', 'français'),\n ('es-es', 'español')] | \n
LANGUAGES_BIDI | \n['he', 'ar', 'fa', 'ur'] | \n
LANGUAGE_CODE | \n'en-us' | \n
LANGUAGE_COOKIE_AGE | \nNone | \n
LANGUAGE_COOKIE_DOMAIN | \nNone | \n
LANGUAGE_COOKIE_NAME | \n'language' | \n
LANGUAGE_COOKIE_PATH | \n'/' | \n
LOCALE_PATHS | \n('/opt/specify7/frontend/locale',) | \n
LOGGING | \n{'disable_existing_loggers': False,\n 'formatters': {'standard': {'datefmt': '%d/%b/%Y %H:%M:%S',\n 'format': '[%(asctime)s] [%(levelname)s] '\n '[%(name)s:%(lineno)s] %(message)s'}},\n 'handlers': {'console': {'class': 'logging.StreamHandler',\n 'formatter': 'standard',\n 'level': 'DEBUG'}},\n 'loggers': {'django.request': {'handlers': ['console'],\n 'level': 'DEBUG',\n 'propagate': False},\n 'specifyweb': {'handlers': ['console'],\n 'level': 'DEBUG',\n 'propagate': False}},\n 'version': 1} | \n
LOGGING_CONFIG | \n'logging.config.dictConfig' | \n
LOGIN_REDIRECT_URL | \n'/' | \n
LOGIN_URL | \n'/accounts/login/' | \n
LOGOUT_REDIRECT_URL | \nNone | \n
MANAGERS | \n() | \n
MASTER_NAME | \n'root' | \n
MASTER_PASSWORD | \n'********************' | \n
MEDIA_ROOT | \n'' | \n
MEDIA_URL | \n'' | \n
MESSAGE_STORAGE | \n'django.contrib.messages.storage.fallback.FallbackStorage' | \n
MIDDLEWARE | \n['django.middleware.gzip.GZipMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.locale.LocaleMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'specifyweb.context.middleware.ContextMiddleware',\n 'specifyweb.permissions.middleware.PermissionsMiddleware',\n 'specifyweb.middleware.general.GeneralMiddleware'] | \n
MIGRATION_MODULES | \n{} | \n
MONTH_DAY_FORMAT | \n'F j' | \n
NOTIFICATION_TTL_DAYS | \n7 | \n
NUMBER_GROUPING | \n0 | \n
OAUTH_LOGIN_PROVIDERS | \n{} | \n
PASSWORD_HASHERS | \n'********************' | \n
PASSWORD_RESET_TIMEOUT_DAYS | \n'********************' | \n
PREPEND_WWW | \nFalse | \n
RAVEN_CONFIG | \nNone | \n
REPORT_RUNNER_HOST | \n'report-runner' | \n
REPORT_RUNNER_PORT | \n'8080' | \n
ROOT_URLCONF | \n'specifyweb.urls' | \n
RO_MODE | \nFalse | \n
SA_DATABASE_URL | \n'mysql://root:root@mariadb:3306/coldFish?charset=utf8' | \n
SA_POOL_RECYCLE | \n3600 | \n
SECRET_KEY | \n'********************' | \n
SECURE_BROWSER_XSS_FILTER | \nFalse | \n
SECURE_CONTENT_TYPE_NOSNIFF | \nFalse | \n
SECURE_HSTS_INCLUDE_SUBDOMAINS | \nFalse | \n
SECURE_HSTS_PRELOAD | \nFalse | \n
SECURE_HSTS_SECONDS | \n0 | \n
SECURE_PROXY_SSL_HEADER | \nNone | \n
SECURE_REDIRECT_EXEMPT | \n[] | \n
SECURE_SSL_HOST | \nNone | \n
SECURE_SSL_REDIRECT | \nFalse | \n
SEPARATE_WEB_ATTACHMENT_FOLDERS | \nNone | \n
SERVER_EMAIL | \n'root@localhost' | \n
SESSION_CACHE_ALIAS | \n'default' | \n
SESSION_COOKIE_AGE | \n1209600 | \n
SESSION_COOKIE_DOMAIN | \nNone | \n
SESSION_COOKIE_HTTPONLY | \nTrue | \n
SESSION_COOKIE_NAME | \n'sessionid' | \n
SESSION_COOKIE_PATH | \n'/' | \n
SESSION_COOKIE_SAMESITE | \n'Lax' | \n
SESSION_COOKIE_SECURE | \nFalse | \n
SESSION_ENGINE | \n'django.contrib.sessions.backends.file' | \n
SESSION_EXPIRE_AT_BROWSER_CLOSE | \nTrue | \n
SESSION_FILE_PATH | \nNone | \n
SESSION_SAVE_EVERY_REQUEST | \nFalse | \n
SESSION_SERIALIZER | \n'django.contrib.sessions.serializers.JSONSerializer' | \n
SETTINGS_MODULE | \n'settings' | \n
SHORT_DATETIME_FORMAT | \n'm/d/Y P' | \n
SHORT_DATE_FORMAT | \n'm/d/Y' | \n
SIGNING_BACKEND | \n'django.core.signing.TimestampSigner' | \n
SILENCED_SYSTEM_CHECKS | \n[] | \n
SITE_ID | \n1 | \n
SPECIFY_CONFIG_DIR | \n'/opt/Specify/config' | \n
SPECIFY_THICK_CLIENT | \n'/opt/Specify' | \n
STATICFILES_DIRS | \n(('config', '/opt/Specify/config'),) | \n
STATICFILES_FINDERS | \n('django.contrib.staticfiles.finders.FileSystemFinder',\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder') | \n
STATICFILES_STORAGE | \n'django.contrib.staticfiles.storage.StaticFilesStorage' | \n
STATIC_ROOT | \n'' | \n
STATIC_URL | \n'/static/' | \n
STATS_URL | \n'https://stats.specifycloud.org/capture' | \n
SUPPORT_LOGIN_TTL | \n300 | \n
TEMPLATES | \n[{'APP_DIRS': True,\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\n 'DIRS': [],\n 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth',\n 'django.template.context_processors.debug',\n 'django.template.context_processors.i18n',\n 'django.template.context_processors.media',\n 'django.template.context_processors.static',\n 'django.template.context_processors.tz',\n 'django.contrib.messages.context_processors.messages',\n 'django.template.context_processors.request']}}] | \n
TEST_NON_SERIALIZED_APPS | \n[] | \n
TEST_RUNNER | \n'django.test.runner.DiscoverRunner' | \n
THICK_CLIENT_LOCATION | \n'/opt/Specify' | \n
THOUSAND_SEPARATOR | \n',' | \n
TIME_FORMAT | \n'P' | \n
TIME_INPUT_FORMATS | \n['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] | \n
TIME_ZONE | \n'America/Chicago' | \n
USE_I18N | \nTrue | \n
USE_L10N | \nTrue | \n
USE_THOUSAND_SEPARATOR | \nFalse | \n
USE_TZ | \nFalse | \n
USE_X_FORWARDED_HOST | \nFalse | \n
USE_X_FORWARDED_PORT | \nFalse | \n
VERSION | \n'issue-2808(debug)' | \n
WB_UPLOAD_LOG_DIR | \n'/home/specify/wb_upload_logs' | \n
WEBPACK_LOADER | \n{'MANIFEST_FILE': '/static/manifest.json'} | \n
WEB_ATTACHMENT_COLLECTION | \n'sp7demofish' | \n
WEB_ATTACHMENT_KEY | \n'********************' | \n
WEB_ATTACHMENT_REQUIRES_KEY_FOR_GET | \n'********************' | \n
WEB_ATTACHMENT_URL | \n'https://demo-assets.specifycloud.org/web_asset_store.xml' | \n
WSGI_APPLICATION | \nNone | \n
X_FRAME_OPTIONS | \n'SAMEORIGIN' | \n
YEAR_MONTH_FORMAT | \n'F Y' | \n
\n You're seeing this error because you have DEBUG = True
in your\n Django settings file. Change that to False
, and Django will\n display a standard page generated by the handler for this status code.\n
('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]})\\n
Request Method: | \\nPUT | \\n
---|---|
Request URL: | \\nhttp://coldfish-issue-2808.test.specifysystems.org/api/specify/collectingevent/6/ | \\n
Django Version: | \\n2.2.10 | \\n
Exception Type: | \\nBusinessRuleException | \\n
Exception Value: | \\n('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \\n
Exception Location: | \\n/opt/specify7/specifyweb/businessrules/uniqueness_rules.py in check_unique, line 45 | \\n
Python Executable: | \\n/opt/specify7/ve/bin/python3.8 | \\n
Python Version: | \\n3.8.0 | \\n
Python Path: | \\n['/opt/specify7',\\n '/opt/specify7',\\n '/opt/specify7/ve/bin',\\n '/usr/lib/python38.zip',\\n '/usr/lib/python3.8',\\n '/usr/lib/python3.8/lib-dynload',\\n '/opt/specify7/ve/lib/python3.8/site-packages',\\n '/opt/specify7'] | \\n
Server time: | \\nMon, 13 Feb 2023 14:51:04 -0600 | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/exception.py
in inner
\\n\\n \\n This decorator is automatically applied to all middleware to ensure that
no middleware leaks an exception and that the next middleware in the stack
can rely on getting a response instead of an exception.
"""
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | \\nValue | \\n
---|---|
exc | \\nBusinessRuleException('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]}) | \\n
get_response | \\n<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0>> | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\\n\\n \\n break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)
except Exception as e:
response = self.process_exception_by_middleware(e, request)…
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
view_name = callback.__name__
else: # CBV
Variable | \\nValue | \\n
---|---|
callback | \\n<function api_view.<locals>.view at 0x7f5819fba670> | \\n
callback_args | \\n() | \\n
callback_kwargs | \\n{'id': '6', 'model': 'collectingevent'} | \\n
middleware_method | \\n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
resolver | \\n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \\n
resolver_match | \\nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\\\w+)/(?P<id>\\\\d+)/$) | \\n
response | \\nNone | \\n
self | \\n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \\n
wrapped_callback | \\n<function api_view.<locals>.view at 0x7f5819fba670> | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/core/handlers/base.py
in _get_response
\\n\\n \\n response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
wrapped_callback = self.make_view_atomic(callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
Variable | \\nValue | \\n
---|---|
callback | \\n<function api_view.<locals>.view at 0x7f5819fba670> | \\n
callback_args | \\n() | \\n
callback_kwargs | \\n{'id': '6', 'model': 'collectingevent'} | \\n
middleware_method | \\n<bound method GeneralMiddleware.process_view of <specifyweb.middleware.general.GeneralMiddleware object at 0x7f581a4860a0>> | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
resolver | \\n<URLResolver 'specifyweb.urls' (None:None) '^/'> | \\n
resolver_match | \\nResolverMatch(func=specifyweb.specify.views.view, args=(), kwargs={'model': 'collectingevent', 'id': '6'}, url_name=None, app_names=[], namespaces=[], route=^api/specify/(?P<model>\\\\w+)/(?P<id>\\\\d+)/$) | \\n
response | \\nNone | \\n
self | \\n<django.core.handlers.wsgi.WSGIHandler object at 0x7f581a461be0> | \\n
wrapped_callback | \\n<function api_view.<locals>.view at 0x7f5819fba670> | \\n
/opt/specify7/specifyweb/specify/views.py
in wrapped
\\n\\n \\n from .specify_jar import specify_jar
def login_maybe_required(view):
@wraps(view)
def wrapped(request, *args, **kwargs):
if not request.user.is_authenticated:
return http.HttpResponseForbidden()
return view(request, *args, **kwargs)…
return wrapped
if settings.ANONYMOUS_USER:
login_maybe_required = lambda func: func
Variable | \\nValue | \\n
---|---|
args | \\n() | \\n
kwargs | \\n{'id': '6', 'model': 'collectingevent'} | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
view | \\n<function api_view.<locals>.view at 0x7f5819fba790> | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/views/decorators/cache.py
in _cache_controlled
\\n\\n \\n )
def cache_control(**kwargs):
def _cache_controller(viewfunc):
@wraps(viewfunc)
def _cache_controlled(request, *args, **kw):
response = viewfunc(request, *args, **kw)…
patch_cache_control(response, **kwargs)
return response
return _cache_controlled
return _cache_controller
Variable | \\nValue | \\n
---|---|
args | \\n() | \\n
kw | \\n{'id': '6', 'model': 'collectingevent'} | \\n
kwargs | \\n{'max_age': 2, 'private': True} | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
viewfunc | \\n<function api_view.<locals>.view at 0x7f5819fba700> | \\n
/opt/specify7/specifyweb/specify/views.py
in view
\\n\\n \\n @cache_control(private=True, max_age=2)
def view(request, *args, **kwargs):
"""RESTful API endpoint for most Specify datamodel resources.
<model> is the table from the Specify datamodel. <id> is the
row id.
"""
try:
return dispatch_func(request, *args, **kwargs)…
except api.StaleObjectException as e:
return HttpResponseConflict(e)
except api.MissingVersionException as e:
return http.HttpResponseBadRequest(e)
except http.Http404 as e:
return http.HttpResponseNotFound(e)
Variable | \\nValue | \\n
---|---|
args | \\n() | \\n
dispatch_func | \\n<function resource_dispatch at 0x7f581a45b5e0> | \\n
kwargs | \\n{'id': '6', 'model': 'collectingevent'} | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
/opt/specify7/specifyweb/specify/api.py
in resource_dispatch
\\n\\n \\n data = json.load(request)
# Look for a version field in the resource data itself.
try:
version = data['version']
except KeyError:
pass
obj = put_resource(request.specify_collection,…
request.specify_user_agent,
model, id, version, data)
resp = HttpResponse(toJson(_obj_to_data(obj, checker)),
content_type='application/json')
Variable | \\nValue | \\n
---|---|
checker | \\n<function table_permissions_checker.<locals>.checker at 0x7f581712f790> | \\n
data | \\n{'collectingeventattachments': [],\\n 'collectingeventattribute': None,\\n 'collectingeventattrs': [],\\n 'collectingeventauthorizations': [],\\n 'collectingtrip': None,\\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\\n 'collectors': [{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/12523/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \\n
id | \\n'6' | \\n
model | \\n'collectingevent' | \\n
request | \\n<WSGIRequest: PUT '/api/specify/collectingevent/6/'> | \\n
request_params | \\n<QueryDict: {}> | \\n
version | \\n2 | \\n
/usr/lib/python3.8/contextlib.py
in inner
\\n\\n \\n """
return self
def __call__(self, func):
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
return func(*args, **kwds)…
return inner
class _GeneratorContextManagerBase:
"""Shared functionality for @contextmanager and @asynccontextmanager."""
Variable | \\nValue | \\n
---|---|
args | \\n(<SimpleLazyObject: <Collection: Collection object (4)>>,\\n <SimpleLazyObject: <Agent: Agent object (1514)>>,\\n 'collectingevent',\\n '6',\\n 2,\\n {'collectingeventattachments': [],\\n 'collectingeventattribute': None,\\n 'collectingeventattrs': [],\\n 'collectingeventauthorizations': [],\\n 'collectingtrip': None,\\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\\n 'collectors': [{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n… <trimmed 5976 bytes string> | \\n
func | \\n<function put_resource at 0x7f581a463430> | \\n
kwds | \\n{} | \\n
self | \\n<django.db.transaction.Atomic object at 0x7f581a461670> | \\n
/opt/specify7/specifyweb/specify/api.py
in put_resource
\\n\\n \\n for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
@transaction.atomic
def put_resource(collection, agent, name: str, id, version, data: Dict[str, Any]):
return update_obj(collection, agent, name, id, version, data)…
def update_obj(collection, agent, name: str, id, version, data: Dict[str, Any], parent_obj=None):
"""Update the resource with 'id' in model named 'name' with given
'data'.
"""
obj = get_object_or_404(name, id=int(id))
Variable | \\nValue | \\n
---|---|
agent | \\n<SimpleLazyObject: <Agent: Agent object (1514)>> | \\n
collection | \\n<SimpleLazyObject: <Collection: Collection object (4)>> | \\n
data | \\n{'collectingeventattachments': [],\\n 'collectingeventattribute': None,\\n 'collectingeventattrs': [],\\n 'collectingeventauthorizations': [],\\n 'collectingtrip': None,\\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\\n 'collectors': [{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/12523/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5696 bytes string> | \\n
id | \\n'6' | \\n
name | \\n'collectingevent' | \\n
version | \\n2 | \\n
/opt/specify7/specifyweb/specify/api.py
in update_obj
\\n\\n \\n obj.modifiedbyagent = agent
bump_version(obj, version)
obj.save(force_update=True)
auditlog.update(obj, agent, parent_obj, dirty)
for dep in dependents_to_delete:
delete_obj(collection, agent, dep, parent_obj=obj)
handle_to_many(collection, agent, obj, data)…
return obj
def bump_version(obj, version) -> None:
"""Implements the optimistic locking mechanism.
If the Django model resource 'obj' has a version field and it
Variable | \\nValue | \\n
---|---|
agent | \\n<SimpleLazyObject: <Agent: Agent object (1514)>> | \\n
collection | \\n<SimpleLazyObject: <Collection: Collection object (4)>> | \\n
data | \\n{'collectingeventattachments': [],\\n 'collectingeventattribute': None,\\n 'collectingeventattrs': [],\\n 'collectingeventauthorizations': [],\\n 'collectingtrip': None,\\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\\n 'collectors': [{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/12523/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \\n
dependents_to_delete | \\n[] | \\n
dirty | \\n[] | \\n
fk_dirty | \\n[] | \\n
id | \\n'6' | \\n
name | \\n'collectingevent' | \\n
obj | \\n<Collectingevent: Collectingevent object (6)> | \\n
parent_obj | \\nNone | \\n
version | \\n2 | \\n
/opt/specify7/specifyweb/specify/api.py
in handle_to_many
\\n\\n \\n # Update an existing related object.
rel_obj = update_obj(collection, agent,
rel_model, rel_data['id'],
rel_data['version'], rel_data,
parent_obj=obj)
else:
# Create a new related object.
rel_obj = create_obj(collection, agent, rel_model, rel_data, parent_obj=obj)…
ids.append(rel_obj.id) # Record the id as one to keep.
# Delete related objects not in the ids list.
# TODO: Check versions for optimistic locking.
to_delete = getattr(obj, field_name).exclude(id__in=ids)
for rel_obj in to_delete:
Variable | \\nValue | \\n
---|---|
agent | \\n<SimpleLazyObject: <Agent: Agent object (1514)>> | \\n
collection | \\n<SimpleLazyObject: <Collection: Collection object (4)>> | \\n
data | \\n{'collectingeventattachments': [],\\n 'collectingeventattribute': None,\\n 'collectingeventattrs': [],\\n 'collectingeventauthorizations': [],\\n 'collectingtrip': None,\\n 'collectionobjects': '/api/specify/collectionobject/?collectingevent=6',\\n 'collectors': [{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/12523/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05… <trimmed 5551 bytes string> | \\n
field | \\n<ManyToOneRel: specify.collector> | \\n
field_name | \\n'collectors' | \\n
ids | \\n[14028, 15627, 14191, 13629, 12523] | \\n
obj | \\n<Collectingevent: Collectingevent object (6)> | \\n
rel_data | \\n{'agent': '/api/specify/agent/626/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'division': '/api/specify/division/2/',\\n 'remarks': None} | \\n
rel_model | \\n<class 'specifyweb.specify.models.Collector'> | \\n
rel_obj | \\n<Collector: Collector object (12523)> | \\n
to_delete | \\n<QuerySet []> | \\n
val | \\n[{'agent': '/api/specify/agent/2244/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14028,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 0,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14028/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:48:50',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/322/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 15627,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 2,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/15627/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:16',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/106/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 14191,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 3,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/14191/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:36',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/380/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 13629,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 4,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/13629/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:49:52',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/1637/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'createdbyagent': '/api/specify/agent/1986/',\\n 'division': '/api/specify/division/2/',\\n 'id': 12523,\\n 'isprimary': True,\\n 'modifiedbyagent': '/api/specify/agent/1514/',\\n 'ordernumber': 5,\\n 'remarks': None,\\n 'resource_uri': '/api/specify/collector/12523/',\\n 'text1': None,\\n 'text2': None,\\n 'timestampcreated': '2010-09-28T09:54:05',\\n 'timestampmodified': '2010-09-28T09:50:06',\\n 'version': 0,\\n 'yesno1': None,\\n 'yesno2': None},\\n {'agent': '/api/specify/agent/626/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'division': '/api/specify/division/2/',\\n 'remarks': None}] | \\n
/opt/specify7/specifyweb/specify/api.py
in create_obj
\\n\\n \\n data = cleanData(model, data, agent)
obj = model()
handle_fk_fields(collection, agent, obj, data)
set_fields_from_data(obj, data)
set_field_if_exists(obj, 'createdbyagent', agent)
set_field_if_exists(obj, 'collectionmemberid', collection.id)
try:
autonumber_and_save(collection, agent.specifyuser, obj)…
except AutonumberOverflowException as e:
logger.warn("autonumbering overflow: %s", e)
if obj.id is not None: # was the object actually saved?
check_table_permissions(collection, agent, obj, "create")
auditlog.insert(obj, agent, parent_obj)
Variable | \\nValue | \\n
---|---|
agent | \\n<SimpleLazyObject: <Agent: Agent object (1514)>> | \\n
collection | \\n<SimpleLazyObject: <Collection: Collection object (4)>> | \\n
data | \\n{'agent': '/api/specify/agent/626/',\\n 'collectingevent': <Collectingevent: Collectingevent object (6)>,\\n 'division': '/api/specify/division/2/',\\n 'remarks': None} | \\n
model | \\n<class 'specifyweb.specify.models.Collector'> | \\n
obj | \\n<Collector: Collector object (None)> | \\n
parent_obj | \\n<Collectingevent: Collectingevent object (6)> | \\n
/opt/specify7/specifyweb/specify/autonumbering.py
in autonumber_and_save
\\n\\n \\n for vals in [formatter.parse(value)]
if formatter.needs_autonumber(vals)]
if len(autonumber_fields) > 0:
do_autonumbering(collection, obj, autonumber_fields)
else:
logger.debug("no fields to autonumber for %s", obj)
obj.save()…
def do_autonumbering(collection, obj, fields: List[Tuple[UIFormatter, Sequence[str]]]) -> None:
logger.debug("autonumbering %s fields: %s", obj, fields)
# The autonumber action is prepared and thunked outside the locked table
# context since it looks at other tables and that is not allowed by mysql
Variable | \\nValue | \\n
---|---|
autonumber_fields | \\n[] | \\n
collection | \\n<SimpleLazyObject: <Collection: Collection object (4)>> | \\n
obj | \\n<Collector: Collector object (None)> | \\n
uiformatters | \\n[] | \\n
user | \\n<Specifyuser: Specifyuser object (2)> | \\n
/opt/specify7/specifyweb/specify/build_models.py
in save
\\n\\n \\n if table.django_name in orderings:
ordering += orderings[table.django_name]
if 'rankid' in attrs:
ordering += ('rankid', )
def save(self, *args, **kwargs):
try:
return super(model, self).save(*args, **kwargs)…
except AbortSave:
return
attrs['save'] = save
attrs['Meta'] = Meta
Variable | \\nValue | \\n
---|---|
args | \\n() | \\n
kwargs | \\n{} | \\n
model | \\n<class 'specifyweb.specify.models.Collector'> | \\n
self | \\n<Collector: Collector object (None)> | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save
\\n\\n \\n for field in self._meta.concrete_fields:
if not field.primary_key and not hasattr(field, 'through'):
field_names.add(field.attname)
loaded_fields = field_names.difference(deferred_fields)
if loaded_fields:
update_fields = frozenset(loaded_fields)
self.save_base(using=using, force_insert=force_insert,…
force_update=force_update, update_fields=update_fields)
save.alters_data = True
def save_base(self, raw=False, force_insert=False,
force_update=False, using=None, update_fields=None):
"""
Variable | \\nValue | \\n
---|---|
deferred_fields | \\nset() | \\n
field | \\n<django.db.models.fields.related.ForeignKey: modifiedbyagent> | \\n
force_insert | \\nFalse | \\n
force_update | \\nFalse | \\n
obj | \\n<Division: Division object (2)> | \\n
self | \\n<Collector: Collector object (None)> | \\n
update_fields | \\nNone | \\n
using | \\n'default' | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/db/models/base.py
in save_base
\\n\\n \\n assert update_fields is None or update_fields
cls = origin = self.__class__
# Skip proxies, but keep the origin as the proxy model.
if cls._meta.proxy:
cls = cls._meta.concrete_model
meta = cls._meta
if not meta.auto_created:
pre_save.send(…
sender=origin, instance=self, raw=raw, using=using,
update_fields=update_fields,
)
# A transaction isn't needed if one query is issued.
if meta.parents:
context_manager = transaction.atomic(using=using, savepoint=False)
Variable | \\nValue | \\n
---|---|
cls | \\n<class 'specifyweb.specify.models.Collector'> | \\n
force_insert | \\nFalse | \\n
force_update | \\nFalse | \\n
meta | \\n<Options for Collector> | \\n
origin | \\n<class 'specifyweb.specify.models.Collector'> | \\n
raw | \\nFalse | \\n
self | \\n<Collector: Collector object (None)> | \\n
update_fields | \\nNone | \\n
using | \\n'default' | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in send
\\n\\n \\n Named arguments which will be passed to receivers.
Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return […
(receiver, receiver(signal=self, sender=sender, **named))
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Variable | \\nValue | \\n
---|---|
named | \\n{'instance': <Collector: Collector object (None)>,\\n 'raw': False,\\n 'update_fields': None,\\n 'using': 'default'} | \\n
self | \\n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \\n
sender | \\n<class 'specifyweb.specify.models.Collector'> | \\n
/opt/specify7/ve/lib/python3.8/site-packages/django/dispatch/dispatcher.py
in <listcomp>
\\n\\n \\n Return a list of tuple pairs [(receiver, response), ... ].
"""
if not self.receivers or self.sender_receivers_cache.get(sender) is NO_RECEIVERS:
return []
return [
(receiver, receiver(signal=self, sender=sender, **named))…
for receiver in self._live_receivers(sender)
]
def send_robust(self, sender, **named):
"""
Send signal from sender to all connected receivers catching errors.
Variable | \\nValue | \\n
---|---|
.0 | \\n<list_iterator object at 0x7f5815dc5910> | \\n
named | \\n{'instance': <Collector: Collector object (None)>,\\n 'raw': False,\\n 'update_fields': None,\\n 'using': 'default'} | \\n
receiver | \\n<function orm_signal_handler.<locals>._dec.<locals>.handler at 0x7f581a5bfc10> | \\n
self | \\n<django.db.models.signals.ModelSignal object at 0x7f581ed6e730> | \\n
sender | \\n<class 'specifyweb.specify.models.Collector'> | \\n
/opt/specify7/specifyweb/businessrules/orm_signal_handler.py
in handler
\\n\\n \\n receiver_kwargs = {}
if model is not None:
receiver_kwargs['sender'] = getattr(models, model)
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
# since the rule knows what model the signal comes from
# the sender value is redundant.
rule(kwargs['instance'])…
else:
def handler(sender, **kwargs):
if kwargs.get('raw', False): return
rule(sender, kwargs['instance'])
return receiver(getattr(signals, signal), **receiver_kwargs)(handler)
Variable | \\nValue | \\n
---|---|
kwargs | \\n{'instance': <Collector: Collector object (None)>,\\n 'raw': False,\\n 'signal': <django.db.models.signals.ModelSignal object at 0x7f581ed6e730>,\\n 'update_fields': None,\\n 'using': 'default'} | \\n
rule | \\n<function make_uniqueness_rule.<locals>.check_unique at 0x7f581a5bf940> | \\n
sender | \\n<class 'specifyweb.specify.models.Collector'> | \\n
/opt/specify7/specifyweb/businessrules/uniqueness_rules.py
in check_unique
\\n\\n \\n if value is None: return
conflicts = model.objects.only('id').filter(**{
parent_field + '_id': parent,
unique_field: value})
if instance.id is not None:
conflicts = conflicts.exclude(id=instance.id)
if conflicts:
raise BusinessRuleException(…
"{} must have unique {} in {}".format(table_name, unique_field, parent_field),
{"table" : table_name,
"localizationKey" : "childFieldNotUnique",
"fieldName" : unique_field,
"fieldData" : (unique_field, serialize_django_obj(value)),
"parentField" : parent_field,
Variable | \\nValue | \\n
---|---|
conflicts | \\n<QuerySet [<Collector: Collector object (2500)>]> | \\n
instance | \\n<Collector: Collector object (None)> | \\n
model | \\n<class 'specifyweb.specify.models.Collector'> | \\n
parent | \\n6 | \\n
parent_field | \\n'collectingevent' | \\n
table_name | \\n'Collector' | \\n
unique_field | \\n'agent' | \\n
value | \\n<Agent: Agent object (626)> | \\n
Specifyuser object (2)
\\n \\n\\nNo GET data
\\n \\n\\nNo POST data
\\n \\nNo FILES data
\\n \\n\\n\\nVariable | \\nValue | \\n
---|---|
csrftoken | \\n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \\n
collection | \\n'4' | \\n
sessionid | \\n'j9ticyfverpw08kowuq6shl07psrvmdv' | \\n
Variable | \\nValue | \\n
---|---|
CONTENT_LENGTH | \\n'3750' | \\n
CONTENT_TYPE | \\n'application/json' | \\n
CSRF_COOKIE | \\n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \\n
HTTP_ACCEPT | \\n'application/json' | \\n
HTTP_ACCEPT_ENCODING | \\n'gzip, deflate, br' | \\n
HTTP_ACCEPT_LANGUAGE | \\n'en-US,en;q=0.5' | \\n
HTTP_CONNECTION | \\n'close' | \\n
HTTP_COOKIE | \\n('csrftoken=YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m; '\\n 'collection=4; sessionid=j9ticyfverpw08kowuq6shl07psrvmdv') | \\n
HTTP_HOST | \\n'coldfish-issue-2808.test.specifysystems.org' | \\n
HTTP_ORIGIN | \\n'https://coldfish-issue-2808.test.specifysystems.org' | \\n
HTTP_REFERER | \\n'https://coldfish-issue-2808.test.specifysystems.org/specify/view/collectingevent/6/?recordsetid=132' | \\n
HTTP_SEC_FETCH_DEST | \\n'empty' | \\n
HTTP_SEC_FETCH_MODE | \\n'cors' | \\n
HTTP_SEC_FETCH_SITE | \\n'same-origin' | \\n
HTTP_USER_AGENT | \\n('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 '\\n 'Firefox/110.0') | \\n
HTTP_X_CSRFTOKEN | \\n'YiPyxN6fxGRjh406JNLrdCBYV7A2OcjOS9vlMz0Nua9TkGtfNVqYNZfmxVywsa1m' | \\n
HTTP_X_FORWARDED_FOR | \\n'129.237.90.147' | \\n
HTTP_X_REAL_IP | \\n'129.237.90.147' | \\n
PATH_INFO | \\n'/api/specify/collectingevent/6/' | \\n
QUERY_STRING | \\n'' | \\n
RAW_URI | \\n'/api/specify/collectingevent/6/' | \\n
REMOTE_ADDR | \\n'172.20.0.10' | \\n
REMOTE_PORT | \\n'40772' | \\n
REQUEST_METHOD | \\n'PUT' | \\n
SCRIPT_NAME | \\n'' | \\n
SERVER_NAME | \\n'0.0.0.0' | \\n
SERVER_PORT | \\n'8000' | \\n
SERVER_PROTOCOL | \\n'HTTP/1.0' | \\n
SERVER_SOFTWARE | \\n'gunicorn/20.1.0' | \\n
gunicorn.socket | \\n<socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.20.0.24', 8000), raddr=('172.20.0.10', 40772)> | \\n
wsgi.errors | \\n<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f5815dd8fd0> | \\n
wsgi.file_wrapper | \\n'' | \\n
wsgi.input | \\n<gunicorn.http.body.Body object at 0x7f5815dcf3a0> | \\n
wsgi.input_terminated | \\nTrue | \\n
wsgi.multiprocess | \\nTrue | \\n
wsgi.multithread | \\nFalse | \\n
wsgi.run_once | \\nFalse | \\n
wsgi.url_scheme | \\n'http' | \\n
wsgi.version | \\n(1, 0) | \\n
settings
Setting | \\nValue | \\n
---|---|
ABSOLUTE_URL_OVERRIDES | \\n{} | \\n
ADMINS | \\n() | \\n
ADMIN_MEDIA_PREFIX | \\n'/static/admin/' | \\n
ALLOWED_HOSTS | \\n['*'] | \\n
ALLOW_SPECIFY6_PASSWORDS | \\n'********************' | \\n
ALLOW_SUPPORT_LOGIN | \\nFalse | \\n
ANONYMOUS_USER | \\nNone | \\n
APPEND_SLASH | \\nTrue | \\n
AUTHENTICATION_BACKENDS | \\n['django.contrib.auth.backends.ModelBackend'] | \\n
AUTH_LDAP_SERVER_URI | \\nNone | \\n
AUTH_PASSWORD_VALIDATORS | \\n'********************' | \\n
AUTH_USER_MODEL | \\n'specify.Specifyuser' | \\n
CACHES | \\n{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} | \\n
CACHE_MIDDLEWARE_ALIAS | \\n'default' | \\n
CACHE_MIDDLEWARE_KEY_PREFIX | \\n'********************' | \\n
CACHE_MIDDLEWARE_SECONDS | \\n600 | \\n
CELERY_BROKER_URL | \\n'redis://redis/0' | \\n
CELERY_RESULT_BACKEND | \\n'redis://redis/1' | \\n
CELERY_TASK_DEFAULT_QUEUE | \\n'coldfish-issue-2808' | \\n
CSRF_COOKIE_AGE | \\n31449600 | \\n
CSRF_COOKIE_DOMAIN | \\nNone | \\n
CSRF_COOKIE_HTTPONLY | \\nFalse | \\n
CSRF_COOKIE_NAME | \\n'csrftoken' | \\n
CSRF_COOKIE_PATH | \\n'/' | \\n
CSRF_COOKIE_SAMESITE | \\n'Lax' | \\n
CSRF_COOKIE_SECURE | \\nFalse | \\n
CSRF_FAILURE_VIEW | \\n'django.views.csrf.csrf_failure' | \\n
CSRF_HEADER_NAME | \\n'HTTP_X_CSRFTOKEN' | \\n
CSRF_TRUSTED_ORIGINS | \\n[] | \\n
CSRF_USE_SESSIONS | \\nFalse | \\n
DATABASES | \\n{'default': {'ATOMIC_REQUESTS': False,\\n 'AUTOCOMMIT': True,\\n 'CONN_MAX_AGE': 0,\\n 'ENGINE': 'specifyweb.hibernateboolsbackend.backends.mysql',\\n 'HOST': 'mariadb',\\n 'NAME': 'coldFish',\\n 'OPTIONS': {},\\n 'PASSWORD': '********************',\\n 'PORT': '',\\n 'TEST': {'CHARSET': None,\\n 'COLLATION': None,\\n 'MIRROR': None,\\n 'NAME': None},\\n 'TIME_ZONE': None,\\n 'USER': 'root'}} | \\n
DATABASE_HOST | \\n'mariadb' | \\n
DATABASE_NAME | \\n'coldFish' | \\n
DATABASE_OPTIONS | \\n{} | \\n
DATABASE_PORT | \\n'' | \\n
DATABASE_ROUTERS | \\n[] | \\n
DATA_UPLOAD_MAX_MEMORY_SIZE | \\n419430400 | \\n
DATA_UPLOAD_MAX_NUMBER_FIELDS | \\n1000 | \\n
DATETIME_FORMAT | \\n'N j, Y, P' | \\n
DATETIME_INPUT_FORMATS | \\n['%Y-%m-%d %H:%M:%S',\\n '%Y-%m-%d %H:%M:%S.%f',\\n '%Y-%m-%d %H:%M',\\n '%Y-%m-%d',\\n '%m/%d/%Y %H:%M:%S',\\n '%m/%d/%Y %H:%M:%S.%f',\\n '%m/%d/%Y %H:%M',\\n '%m/%d/%Y',\\n '%m/%d/%y %H:%M:%S',\\n '%m/%d/%y %H:%M:%S.%f',\\n '%m/%d/%y %H:%M',\\n '%m/%d/%y'] | \\n
DATE_FORMAT | \\n'N j, Y' | \\n
DATE_INPUT_FORMATS | \\n['%Y-%m-%d',\\n '%m/%d/%Y',\\n '%m/%d/%y',\\n '%b %d %Y',\\n '%b %d, %Y',\\n '%d %b %Y',\\n '%d %b, %Y',\\n '%B %d %Y',\\n '%B %d, %Y',\\n '%d %B %Y',\\n '%d %B, %Y'] | \\n
DEBUG | \\nTrue | \\n
DEBUG_PROPAGATE_EXCEPTIONS | \\nFalse | \\n
DECIMAL_SEPARATOR | \\n'.' | \\n
DEFAULT_CHARSET | \\n'utf-8' | \\n
DEFAULT_CONTENT_TYPE | \\n'text/html' | \\n
DEFAULT_EXCEPTION_REPORTER_FILTER | \\n'django.views.debug.SafeExceptionReporterFilter' | \\n
DEFAULT_FILE_STORAGE | \\n'django.core.files.storage.FileSystemStorage' | \\n
DEFAULT_FROM_EMAIL | \\n'webmaster@localhost' | \\n
DEFAULT_INDEX_TABLESPACE | \\n'' | \\n
DEFAULT_TABLESPACE | \\n'' | \\n
DEPOSITORY_DIR | \\n'/volumes/static-files/depository' | \\n
DISABLE_AUDITING | \\nFalse | \\n
DISALLOWED_USER_AGENTS | \\n[] | \\n
EMAIL_BACKEND | \\n'django.core.mail.backends.smtp.EmailBackend' | \\n
EMAIL_HOST | \\n'localhost' | \\n
EMAIL_HOST_PASSWORD | \\n'********************' | \\n
EMAIL_HOST_USER | \\n'' | \\n
EMAIL_PORT | \\n25 | \\n
EMAIL_SSL_CERTFILE | \\nNone | \\n
EMAIL_SSL_KEYFILE | \\n'********************' | \\n
EMAIL_SUBJECT_PREFIX | \\n'[Django] ' | \\n
EMAIL_TIMEOUT | \\nNone | \\n
EMAIL_USE_LOCALTIME | \\nFalse | \\n
EMAIL_USE_SSL | \\nFalse | \\n
EMAIL_USE_TLS | \\nFalse | \\n
FILE_CHARSET | \\n'utf-8' | \\n
FILE_UPLOAD_DIRECTORY_PERMISSIONS | \\nNone | \\n
FILE_UPLOAD_HANDLERS | \\n['django.core.files.uploadhandler.MemoryFileUploadHandler',\\n 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] | \\n
FILE_UPLOAD_MAX_MEMORY_SIZE | \\n104857600 | \\n
FILE_UPLOAD_PERMISSIONS | \\nNone | \\n
FILE_UPLOAD_TEMP_DIR | \\nNone | \\n
FIRST_DAY_OF_WEEK | \\n0 | \\n
FIXTURE_DIRS | \\n[] | \\n
FORCE_SCRIPT_NAME | \\nNone | \\n
FORMAT_MODULE_PATH | \\nNone | \\n
FORM_RENDERER | \\n'django.forms.renderers.DjangoTemplates' | \\n
IGNORABLE_404_URLS | \\n[] | \\n
INSTALLED_APPS | \\n('django.contrib.sessions',\\n 'django.contrib.staticfiles',\\n 'django.contrib.contenttypes',\\n 'django.contrib.auth',\\n 'specifyweb.specify',\\n 'specifyweb.permissions',\\n 'specifyweb.accounts',\\n 'specifyweb.stored_queries',\\n 'specifyweb.businessrules',\\n 'specifyweb.express_search',\\n 'specifyweb.context',\\n 'specifyweb.attachment_gw',\\n 'specifyweb.frontend',\\n 'specifyweb.barvis',\\n 'specifyweb.report_runner',\\n 'specifyweb.interactions',\\n 'specifyweb.workbench',\\n 'specifyweb.notifications',\\n 'specifyweb.export',\\n 'specifyweb.raven_placeholder',\\n 'django_jsonfield_backport') | \\n
INTERNAL_IPS | \\n[] | \\n
JAVA_PATH | \\n'/usr/bin/java' | \\n
LANGUAGES | \\n[('en-us', 'English'),\\n ('ru-ru', 'русский'),\\n ('uk-ua', 'українська'),\\n ('fr-fr', 'français'),\\n ('es-es', 'español')] | \\n
LANGUAGES_BIDI | \\n['he', 'ar', 'fa', 'ur'] | \\n
LANGUAGE_CODE | \\n'en-us' | \\n
LANGUAGE_COOKIE_AGE | \\nNone | \\n
LANGUAGE_COOKIE_DOMAIN | \\nNone | \\n
LANGUAGE_COOKIE_NAME | \\n'language' | \\n
LANGUAGE_COOKIE_PATH | \\n'/' | \\n
LOCALE_PATHS | \\n('/opt/specify7/frontend/locale',) | \\n
LOGGING | \\n{'disable_existing_loggers': False,\\n 'formatters': {'standard': {'datefmt': '%d/%b/%Y %H:%M:%S',\\n 'format': '[%(asctime)s] [%(levelname)s] '\\n '[%(name)s:%(lineno)s] %(message)s'}},\\n 'handlers': {'console': {'class': 'logging.StreamHandler',\\n 'formatter': 'standard',\\n 'level': 'DEBUG'}},\\n 'loggers': {'django.request': {'handlers': ['console'],\\n 'level': 'DEBUG',\\n 'propagate': False},\\n 'specifyweb': {'handlers': ['console'],\\n 'level': 'DEBUG',\\n 'propagate': False}},\\n 'version': 1} | \\n
LOGGING_CONFIG | \\n'logging.config.dictConfig' | \\n
LOGIN_REDIRECT_URL | \\n'/' | \\n
LOGIN_URL | \\n'/accounts/login/' | \\n
LOGOUT_REDIRECT_URL | \\nNone | \\n
MANAGERS | \\n() | \\n
MASTER_NAME | \\n'root' | \\n
MASTER_PASSWORD | \\n'********************' | \\n
MEDIA_ROOT | \\n'' | \\n
MEDIA_URL | \\n'' | \\n
MESSAGE_STORAGE | \\n'django.contrib.messages.storage.fallback.FallbackStorage' | \\n
MIDDLEWARE | \\n['django.middleware.gzip.GZipMiddleware',\\n 'django.contrib.sessions.middleware.SessionMiddleware',\\n 'django.middleware.locale.LocaleMiddleware',\\n 'django.middleware.common.CommonMiddleware',\\n 'django.middleware.csrf.CsrfViewMiddleware',\\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\\n 'specifyweb.context.middleware.ContextMiddleware',\\n 'specifyweb.permissions.middleware.PermissionsMiddleware',\\n 'specifyweb.middleware.general.GeneralMiddleware'] | \\n
MIGRATION_MODULES | \\n{} | \\n
MONTH_DAY_FORMAT | \\n'F j' | \\n
NOTIFICATION_TTL_DAYS | \\n7 | \\n
NUMBER_GROUPING | \\n0 | \\n
OAUTH_LOGIN_PROVIDERS | \\n{} | \\n
PASSWORD_HASHERS | \\n'********************' | \\n
PASSWORD_RESET_TIMEOUT_DAYS | \\n'********************' | \\n
PREPEND_WWW | \\nFalse | \\n
RAVEN_CONFIG | \\nNone | \\n
REPORT_RUNNER_HOST | \\n'report-runner' | \\n
REPORT_RUNNER_PORT | \\n'8080' | \\n
ROOT_URLCONF | \\n'specifyweb.urls' | \\n
RO_MODE | \\nFalse | \\n
SA_DATABASE_URL | \\n'mysql://root:root@mariadb:3306/coldFish?charset=utf8' | \\n
SA_POOL_RECYCLE | \\n3600 | \\n
SECRET_KEY | \\n'********************' | \\n
SECURE_BROWSER_XSS_FILTER | \\nFalse | \\n
SECURE_CONTENT_TYPE_NOSNIFF | \\nFalse | \\n
SECURE_HSTS_INCLUDE_SUBDOMAINS | \\nFalse | \\n
SECURE_HSTS_PRELOAD | \\nFalse | \\n
SECURE_HSTS_SECONDS | \\n0 | \\n
SECURE_PROXY_SSL_HEADER | \\nNone | \\n
SECURE_REDIRECT_EXEMPT | \\n[] | \\n
SECURE_SSL_HOST | \\nNone | \\n
SECURE_SSL_REDIRECT | \\nFalse | \\n
SEPARATE_WEB_ATTACHMENT_FOLDERS | \\nNone | \\n
SERVER_EMAIL | \\n'root@localhost' | \\n
SESSION_CACHE_ALIAS | \\n'default' | \\n
SESSION_COOKIE_AGE | \\n1209600 | \\n
SESSION_COOKIE_DOMAIN | \\nNone | \\n
SESSION_COOKIE_HTTPONLY | \\nTrue | \\n
SESSION_COOKIE_NAME | \\n'sessionid' | \\n
SESSION_COOKIE_PATH | \\n'/' | \\n
SESSION_COOKIE_SAMESITE | \\n'Lax' | \\n
SESSION_COOKIE_SECURE | \\nFalse | \\n
SESSION_ENGINE | \\n'django.contrib.sessions.backends.file' | \\n
SESSION_EXPIRE_AT_BROWSER_CLOSE | \\nTrue | \\n
SESSION_FILE_PATH | \\nNone | \\n
SESSION_SAVE_EVERY_REQUEST | \\nFalse | \\n
SESSION_SERIALIZER | \\n'django.contrib.sessions.serializers.JSONSerializer' | \\n
SETTINGS_MODULE | \\n'settings' | \\n
SHORT_DATETIME_FORMAT | \\n'm/d/Y P' | \\n
SHORT_DATE_FORMAT | \\n'm/d/Y' | \\n
SIGNING_BACKEND | \\n'django.core.signing.TimestampSigner' | \\n
SILENCED_SYSTEM_CHECKS | \\n[] | \\n
SITE_ID | \\n1 | \\n
SPECIFY_CONFIG_DIR | \\n'/opt/Specify/config' | \\n
SPECIFY_THICK_CLIENT | \\n'/opt/Specify' | \\n
STATICFILES_DIRS | \\n(('config', '/opt/Specify/config'),) | \\n
STATICFILES_FINDERS | \\n('django.contrib.staticfiles.finders.FileSystemFinder',\\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder') | \\n
STATICFILES_STORAGE | \\n'django.contrib.staticfiles.storage.StaticFilesStorage' | \\n
STATIC_ROOT | \\n'' | \\n
STATIC_URL | \\n'/static/' | \\n
STATS_URL | \\n'https://stats.specifycloud.org/capture' | \\n
SUPPORT_LOGIN_TTL | \\n300 | \\n
TEMPLATES | \\n[{'APP_DIRS': True,\\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\\n 'DIRS': [],\\n 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth',\\n 'django.template.context_processors.debug',\\n 'django.template.context_processors.i18n',\\n 'django.template.context_processors.media',\\n 'django.template.context_processors.static',\\n 'django.template.context_processors.tz',\\n 'django.contrib.messages.context_processors.messages',\\n 'django.template.context_processors.request']}}] | \\n
TEST_NON_SERIALIZED_APPS | \\n[] | \\n
TEST_RUNNER | \\n'django.test.runner.DiscoverRunner' | \\n
THICK_CLIENT_LOCATION | \\n'/opt/Specify' | \\n
THOUSAND_SEPARATOR | \\n',' | \\n
TIME_FORMAT | \\n'P' | \\n
TIME_INPUT_FORMATS | \\n['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] | \\n
TIME_ZONE | \\n'America/Chicago' | \\n
USE_I18N | \\nTrue | \\n
USE_L10N | \\nTrue | \\n
USE_THOUSAND_SEPARATOR | \\nFalse | \\n
USE_TZ | \\nFalse | \\n
USE_X_FORWARDED_HOST | \\nFalse | \\n
USE_X_FORWARDED_PORT | \\nFalse | \\n
VERSION | \\n'issue-2808(debug)' | \\n
WB_UPLOAD_LOG_DIR | \\n'/home/specify/wb_upload_logs' | \\n
WEBPACK_LOADER | \\n{'MANIFEST_FILE': '/static/manifest.json'} | \\n
WEB_ATTACHMENT_COLLECTION | \\n'sp7demofish' | \\n
WEB_ATTACHMENT_KEY | \\n'********************' | \\n
WEB_ATTACHMENT_REQUIRES_KEY_FOR_GET | \\n'********************' | \\n
WEB_ATTACHMENT_URL | \\n'https://demo-assets.specifycloud.org/web_asset_store.xml' | \\n
WSGI_APPLICATION | \\nNone | \\n
X_FRAME_OPTIONS | \\n'SAMEORIGIN' | \\n
YEAR_MONTH_FORMAT | \\n'F Y' | \\n
\\n You're seeing this error because you have DEBUG = True
in your\\n Django settings file. Change that to False
, and Django will\\n display a standard page generated by the handler for this status code.\\n