Field 'id' expected a number but got 'vshn' #118

Closed
opened 2025-06-23 13:47:43 +00:00 by tobru · 0 comments
Owner

Description

The following issue was caught on GlitchTip on GET /org/vshn/:

ValueError:invalid literal for int() with base 10: 'vshn'
File "django/db/models/fields/__init__.py" , line 2128 , in get_prep_value
     return int(value)

ValueError:Field 'id' expected a number but got 'vshn'.
File "django/core/handlers/exception.py" , line 55 , in inner
     response = get_response(request)
File "servala/core/middleware.py" , line 23 , in __call__
     request.organization = get_object_or_404(Organization, pk=pk)
File "django/shortcuts.py" , line 90 , in get_object_or_404
     return queryset.get(*args, **kwargs)
File "django/db/models/query.py" , line 619 , in get
     clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
File "django/db/models/query.py" , line 1493 , in filter
     return self._filter_or_exclude(False, args, kwargs)
File "django/db/models/query.py" , line 1511 , in _filter_or_exclude
     clone._filter_or_exclude_inplace(negate, args, kwargs)
File "django/db/models/query.py" , line 1518 , in _filter_or_exclude_inplace
     self._query.add_q(Q(*args, **kwargs))
File "django/db/models/sql/query.py" , line 1646 , in add_q
     clause, _ = self._add_q(q_object, can_reuse)
File "django/db/models/sql/query.py" , line 1678 , in _add_q
     child_clause, needed_inner = self.build_filter(
File "django/db/models/sql/query.py" , line 1588 , in build_filter
     condition = self.build_lookup(lookups, col, value)
File "django/db/models/sql/query.py" , line 1415 , in build_lookup
     lookup = lookup_class(lhs, rhs)
File "django/db/models/lookups.py" , line 38 , in __init__
     self.rhs = self.get_prep_lookup()
File "django/db/models/lookups.py" , line 410 , in get_prep_lookup
     return super().get_prep_lookup()
File "django/db/models/lookups.py" , line 96 , in get_prep_lookup
     return self.lhs.output_field.get_prep_value(self.rhs)
File "django/db/models/fields/__init__.py" , line 2130 , in get_prep_value
     raise e.__class__( 

https://app.glitchtip.com/vshn-ag/issues/3075915

## Description The following issue was caught on GlitchTip on `GET /org/vshn/`: ``` ValueError:invalid literal for int() with base 10: 'vshn' File "django/db/models/fields/__init__.py" , line 2128 , in get_prep_value return int(value) ValueError:Field 'id' expected a number but got 'vshn'. File "django/core/handlers/exception.py" , line 55 , in inner response = get_response(request) File "servala/core/middleware.py" , line 23 , in __call__ request.organization = get_object_or_404(Organization, pk=pk) File "django/shortcuts.py" , line 90 , in get_object_or_404 return queryset.get(*args, **kwargs) File "django/db/models/query.py" , line 619 , in get clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs) File "django/db/models/query.py" , line 1493 , in filter return self._filter_or_exclude(False, args, kwargs) File "django/db/models/query.py" , line 1511 , in _filter_or_exclude clone._filter_or_exclude_inplace(negate, args, kwargs) File "django/db/models/query.py" , line 1518 , in _filter_or_exclude_inplace self._query.add_q(Q(*args, **kwargs)) File "django/db/models/sql/query.py" , line 1646 , in add_q clause, _ = self._add_q(q_object, can_reuse) File "django/db/models/sql/query.py" , line 1678 , in _add_q child_clause, needed_inner = self.build_filter( File "django/db/models/sql/query.py" , line 1588 , in build_filter condition = self.build_lookup(lookups, col, value) File "django/db/models/sql/query.py" , line 1415 , in build_lookup lookup = lookup_class(lhs, rhs) File "django/db/models/lookups.py" , line 38 , in __init__ self.rhs = self.get_prep_lookup() File "django/db/models/lookups.py" , line 410 , in get_prep_lookup return super().get_prep_lookup() File "django/db/models/lookups.py" , line 96 , in get_prep_lookup return self.lhs.output_field.get_prep_value(self.rhs) File "django/db/models/fields/__init__.py" , line 2130 , in get_prep_value raise e.__class__( ``` https://app.glitchtip.com/vshn-ag/issues/3075915
tobru added the
bug
label 2025-06-23 13:47:43 +00:00
tobru added this to the Development Planning project 2025-06-23 13:49:14 +00:00
rixx was assigned by tobru 2025-06-24 18:01:04 +00:00
rixx closed this issue 2025-06-26 12:32:59 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: servala/servala-portal#118
No description provided.