Creating absence fails / absence reasons do not load
Trying to create an absence for a random person:
Seemingly the error is, that absence reasons do not load. There are four empty chips with loading animation.
Traceback (most recent call last):
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/__init__.py", line 2117, in get_prep_value
return int(value)
^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
return view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 188, in _view_wrapper
result = _process_exception(request, e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 186, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 191, in dispatch
responses = [self.get_response(request, entry) for entry in data]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 191, in <listcomp>
responses = [self.get_response(request, entry) for entry in data]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 218, in get_response
execution_result = self.execute_graphql_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/src/aleksis/apps/official/AlekSIS-Core/aleksis/core/views.py", line 1354, in execute_graphql_request
raise error
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphql/execution/execute.py", line 521, in execute_field
result = resolve_fn(source, info, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/aleksis/apps/alsijil/schema/absences.py", line 34, in mutate
kolego_absence, __ = Absence.objects.get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 948, in get_or_create
return self.get(**kwargs), False
^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 635, in get
clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1476, in filter
return self._filter_or_exclude(False, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/polymorphic/query.py", line 174, in _filter_or_exclude
return super()._filter_or_exclude(negate=negate, args=args, kwargs=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1494, in _filter_or_exclude
clone._filter_or_exclude_inplace(negate, args, kwargs)
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1501, in _filter_or_exclude_inplace
self._query.add_q(Q(*args, **kwargs))
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1613, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1645, in _add_q
child_clause, needed_inner = self.build_filter(
^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1559, in build_filter
condition = self.build_lookup(lookups, col, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1389, in build_lookup
lookup = lookup_class(lhs, rhs)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/lookups.py", line 30, in __init__
self.rhs = self.get_prep_lookup()
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/related_lookups.py", line 156, in get_prep_lookup
self.rhs = target_field.get_prep_value(self.rhs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/__init__.py", line 2119, in get_prep_value
raise e.__class__(
graphql.error.graphql_error.GraphQLError: Field 'id' expected a number but got ''.
GraphQL request:2:3
1 | mutation createAbsencesForPersons($persons: [ID]!, $start: Date!, $end: Date!, $comment: String, $reason: ID!) {
2 | createAbsencesForPersons(
| ^
3 | persons: $persons
2024-08-05 21:57:28,704 ERROR django.request[399987]: Internal Server Error: /graphql/
Traceback (most recent call last):
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/__init__.py", line 2117, in get_prep_value
return int(value)
^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
return view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 48, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 188, in _view_wrapper
result = _process_exception(request, e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/utils/decorators.py", line 186, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 191, in dispatch
responses = [self.get_response(request, entry) for entry in data]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 191, in <listcomp>
responses = [self.get_response(request, entry) for entry in data]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphene_django/views.py", line 218, in get_response
execution_result = self.execute_graphql_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/src/aleksis/apps/official/AlekSIS-Core/aleksis/core/views.py", line 1354, in execute_graphql_request
raise error
File "/srv/aleksis-venv/lib/python3.11/site-packages/graphql/execution/execute.py", line 521, in execute_field
result = resolve_fn(source, info, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/aleksis/apps/alsijil/schema/absences.py", line 34, in mutate
kolego_absence, __ = Absence.objects.get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 948, in get_or_create
return self.get(**kwargs), False
^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 635, in get
clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1476, in filter
return self._filter_or_exclude(False, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/polymorphic/query.py", line 174, in _filter_or_exclude
return super()._filter_or_exclude(negate=negate, args=args, kwargs=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1494, in _filter_or_exclude
clone._filter_or_exclude_inplace(negate, args, kwargs)
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/query.py", line 1501, in _filter_or_exclude_inplace
self._query.add_q(Q(*args, **kwargs))
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1613, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1645, in _add_q
child_clause, needed_inner = self.build_filter(
^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1559, in build_filter
condition = self.build_lookup(lookups, col, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 1389, in build_lookup
lookup = lookup_class(lhs, rhs)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/lookups.py", line 30, in __init__
self.rhs = self.get_prep_lookup()
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/related_lookups.py", line 156, in get_prep_lookup
self.rhs = target_field.get_prep_value(self.rhs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/aleksis-venv/lib/python3.11/site-packages/django/db/models/fields/__init__.py", line 2119, in get_prep_value
raise e.__class__(
graphql.error.graphql_error.GraphQLError: Field 'id' expected a number but got ''.
GraphQL request:2:3
1 | mutation createAbsencesForPersons($persons: [ID]!, $start: Date!, $end: Date!, $comment: String, $reason: ID!) {
2 | createAbsencesForPersons(
| ^
3 | persons: $persons
Edited by magicfelix