Skip to content

Conversation

@AKRITI-ENG
Copy link
Contributor

@AKRITI-ENG AKRITI-ENG commented Dec 2, 2025

Fixes #1404

How I fixed it
Updated the template to use the correct URL pattern name that actually exists in the codebase:

  • Changed the URL from "control:event.item" to "control:event.product"
  • Updated the parameter from item=item.pk to product=item.pk to match what the URL expects

Testing done
I've tested this locally and confirmed:

  • Deleting quotas without products works fine
  • Deleting quotas with products now shows the proper confirmation page
  • The Cancel button takes you back to the quotas list as expected
image image

Summary by Sourcery

Bug Fixes:

  • Resolve NoReverseMatch errors on the quota deletion page by using the existing product URL pattern and parameter.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 2, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the quota delete confirmation template to use the correct URL pattern and parameter name for linked products, resolving a NoReverseMatch and ensuring proper navigation from the list of dependent products.

Sequence diagram for resolving linked product URL in quota delete template

sequenceDiagram
  actor Admin
  participant Browser
  participant QuotaDeleteTemplate
  participant DjangoURLResolver as URLResolver
  participant ProductDetailView

  Admin->>Browser: Click linked product name in quota delete page
  Browser->>QuotaDeleteTemplate: Request quota_delete.html
  QuotaDeleteTemplate->>QuotaDeleteTemplate: Render anchor with url control:event.product and param product=item.pk
  QuotaDeleteTemplate-->>Browser: HTML response with correct product link
  Admin->>Browser: Click product link
  Browser->>DjangoURLResolver: HTTP GET /control/event/product/{product_pk}
  DjangoURLResolver->>DjangoURLResolver: Resolve control:event.product with product parameter
  DjangoURLResolver->>ProductDetailView: Dispatch resolved request
  ProductDetailView-->>Browser: Render product detail page
  Browser-->>Admin: Display product detail view
Loading

File-Level Changes

Change Details Files
Fix incorrect URL tag in the quota delete template that caused NoReverseMatch when rendering linked products.
  • Update the Django URL tag to use the existing control:event.product route instead of the non-existent control:event.item route.
  • Change the URL parameter from item=item.pk to product=item.pk so it matches the expected keyword argument for the product route.
  • Ensure that dependent products listed on the quota delete page link correctly to their product detail pages without raising errors.
app/eventyay/control/templates/pretixcontrol/items/quota_delete.html

Assessment against linked issues

Issue Objective Addressed Explanation
#1404 Prevent an error page when attempting to delete a quota that has products attached, and instead show the intended confirmation/message page explaining that the quota cannot be deleted.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@AKRITI-ENG AKRITI-ENG changed the title Fix NoReverseMatch error in quota delete template fix NoReverseMatch error in quota delete template Dec 3, 2025
@AKRITI-ENG AKRITI-ENG marked this pull request as ready for review December 3, 2025 05:56
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AKRITI-ENG AKRITI-ENG changed the title fix NoReverseMatch error in quota delete template fix: NoReverseMatch error in quota delete template Dec 3, 2025
@mariobehling mariobehling requested a review from Copilot December 3, 2025 21:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a NoReverseMatch error in the quota delete template by correcting the URL pattern name and parameter to match the actual URL configuration defined in the codebase.

  • Updated the URL pattern from the non-existent control:event.item to the correct control:event.product
  • Changed the parameter from item= to product= to match the URL pattern's expected parameter name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@Sak1012 Sak1012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR with a rebase

@AKRITI-ENG
Copy link
Contributor Author

@Sak1012 Rebased as requested

@mariobehling mariobehling requested a review from Sak1012 December 9, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Error page when trying to delete a quota tied to a product

2 participants