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

[#1830] Prevent deletion of last website #843

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

pi-sigma
Copy link
Contributor

Taiga #1830

@pi-sigma pi-sigma force-pushed the fix/1830-siteadmin branch 2 times, most recently from 91c989b to 98fb822 Compare November 10, 2023 19:57
@pi-sigma pi-sigma marked this pull request as ready for review November 13, 2023 14:53
@pi-sigma pi-sigma requested a review from stevenbal November 13, 2023 14:53
Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

Looks good overall, though I tested this locally and it doesn't work when doing a delete with the "bulk delete" action from the list view (see https://docs.djangoproject.com/en/3.2/ref/contrib/admin/actions/). I think it would be good if deleting the last Site via the list view could be blocked as well

image

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3743516) 92.84% compared to head (69d688c) 92.85%.
Report is 13 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #843      +/-   ##
===========================================
+ Coverage    92.84%   92.85%   +0.01%     
===========================================
  Files          752      755       +3     
  Lines        26127    26276     +149     
===========================================
+ Hits         24257    24398     +141     
- Misses        1870     1878       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi-sigma pi-sigma requested a review from stevenbal November 14, 2023 12:01
Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

Looks good 👍. I did notice that the delete via the detail page returns both the warning and success message, but since this is an edge case, I don't think it's worth it to override more code just to remove that success message

@stevenbal stevenbal merged commit 43ace36 into develop Nov 16, 2023
@stevenbal stevenbal deleted the fix/1830-siteadmin branch November 16, 2023 08:27
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 this pull request may close these issues.

3 participants