JorgenDIF / PP4-Riot-Rythm-Festival

The freedom of music
0 stars 2 forks source link

Bug Resolved: Application crashes when editing or deleting bands using primary key #70

Open JorgenDIF opened 6 months ago

JorgenDIF commented 6 months ago

Description:

The application crashes when attempting to edit or delete band entries using their primary key. This issue occurs because the URL generation for the edit_band view expects a numeric primary key, but is provided with a slug.

Steps to Reproduce:

Navigate to the band editing page. Attempt to edit or delete a band using a slug instead of a primary key. The application crashes due to incorrect URL parameter. Expected Behavior: The application should allow editing and deleting bands using slugs without crashing.

Actual Behavior:

The application crashes because the URL pattern for edit_band is set to expect a primary key but receives a slug.

Proposed Solution:

Change the URL pattern for the edit_band view to accept a slug (slug:slug>) instead of a primary key (int:pk). This can be implemented by updating the URL configuration in Django to reflect this change. Here is a suggested modification for the URL pattern:

This change ensures more robust handling of identifiers and prevents crashes when non-numeric slugs are used. The system should be thoroughly tested to ensure that all links and references to band editing and deletion are updated accordingly.