TrustPoint-Project / trustpoint

MIT License
5 stars 0 forks source link

[BUG] Selecting only one element, clicking on Download / Delete selected causes HTTP 404 #92

Closed AlexHx8472 closed 1 week ago

AlexHx8472 commented 1 month ago

Please give a concise description of the bug Regardless of the type of table view, if you select only one element and click on Download Selected or Delete Selected, we ge a HTTP 404.

What behavior did you expect? Redirect to single element download page

Which version does the issue occur in? Main branch

Optional notes and context Will wait until trust-stores branch is merged into main to fix it.

Suggested fix Add a redirect in both the TrustStoresMultipleDownloadView and CertificateMultipleDownloadView to TrustStoresDownloadView and CertificateDownloadView, respectively, if there is only one pk found.

if len(self.get_pks()) == 1:
b-rohit commented 1 month ago

I put condition in the javascript to change url based on number of selected box

pushed the changes 743feb1b262ee00435ada8eddaf50e12a03c4d8a

Aircoookie commented 1 week ago

Deletion was already fixed project-wide, but the issue was still present for downloads. I prepared a fix in #135