Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect quatation of special characters in string primary keys #116

Open
insspb opened this issue Sep 19, 2023 · 0 comments · May be fixed by #117
Open

Incorrect quatation of special characters in string primary keys #116

insspb opened this issue Sep 19, 2023 · 0 comments · May be fixed by #117

Comments

@insspb
Copy link

insspb commented Sep 19, 2023

class LocationMunicipality(models.Model):

    name = models.TextField(blank=False, primary_key=True)

obj = LocationMunicipality(name='Carlow/Mayo')
obj.save()

Mass admin will raise the following, if we will try to open one particular object, or several objects at once:

NoReverseMatch

Reverse for 'massadmin_change_view' with keyword arguments '{'app_name': 'location', 'model_name': 'locationmunicipalitydistrict', 'object_ids': 'Carlow/Mayo'}' not found. 1 pattern(s) tried: ['admin/(?P<app_name>[^/]+)/(?P<model_name>[^/]+)\\-masschange/(?P<object_ids>[^/]+)/\\Z']

The problem can be seen here:
Screenshot_20230919_111812

Value not quoted as expected by django admin.

Django admin use own pk quotation quote function from: django.contrib.admin.utils

Patch coming soon.

@insspb insspb linked a pull request Sep 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant