Skip to content

Incorrect decoding of primary key with _ in value from url #72

@WhoisUnknown

Description

@WhoisUnknown

Describe the bug
Incorrect decoding of primary key with _ in value from url

Field example:

code = models.CharField(
        primary_key=True,
)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Django admin list' with CharField field
  2. Click on element with _ in primary_key
  3. Change any value in model
  4. Try to save
  5. Get correct confirmation page and try to save
  6. See error Market with ID “test_5Fmarket“ does not exist. Maybe it was deleted?

Expected behavior
Confirmation page correctly handles escaped characters from url

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Browser: chrome
  • Version: 138.0.7204.94
  • django-admin-confirm = "==1.0.1"
  • django = "==5.0.4"

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions