Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

/admin/core/location/lcfccy/change/ should redirect to correct page #698

Open
sentry-io bot opened this issue Jun 27, 2021 · 2 comments
Open

/admin/core/location/lcfccy/change/ should redirect to correct page #698

sentry-io bot opened this issue Jun 27, 2021 · 2 comments
Labels
django-admin and tools Anything involving the /admin/ tools

Comments

@sentry-io
Copy link

sentry-io bot commented Jun 27, 2021

Sentry Issue: VIAL-C6

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

ValueError: Field 'id' expected a number but got 'lcfccy'.
(14 additional frame(s) were not displayed)
...
  File "django/db/models/sql/query.py", line 1345, in build_filter
    condition = self.build_lookup(lookups, col, value)
  File "django/db/models/sql/query.py", line 1191, in build_lookup
    lookup = lookup_class(lhs, rhs)
  File "django/db/models/lookups.py", line 25, in __init__
    self.rhs = self.get_prep_lookup()
  File "django/db/models/lookups.py", line 77, in get_prep_lookup
    return self.lhs.output_field.get_prep_value(self.rhs)
  File "django/db/models/fields/__init__.py", line 1825, in get_prep_value
    raise e.__class__(
@simonw simonw added the django-admin and tools Anything involving the /admin/ tools label Jun 27, 2021
@simonw
Copy link
Collaborator

simonw commented Jun 27, 2021

https://vial.calltheshots.us/admin/core/location/lcfccy/change/ should redirect to the correct place

This is actually quite an easy fix, since the l in that ID means we can catch it with a separate URL regex and run some custom code to look up the correct location ID and redirect there.

@simonw simonw closed this as completed in 3aca574 Jun 28, 2021
@simonw
Copy link
Collaborator

simonw commented Jun 30, 2021

https://vial.calltheshots.us/admin/core/location/rec7cOYsBzU10AONb/change/ still throws a 500 - re-opening.

@simonw simonw reopened this Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
django-admin and tools Anything involving the /admin/ tools
Projects
None yet
Development

No branches or pull requests

1 participant