Skip to content

Commit

Permalink
Disable deleting of default dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 21, 2024
1 parent 1e581db commit 561f1c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/nav/web/webfront/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ def delete_dashboard(request, did):
return HttpResponseBadRequest('Cannot delete last dashboard')

dash = get_object_or_404(AccountDashboard, pk=did, account=request.account)

if dash.is_default:
return HttpResponseBadRequest('Cannot delete default dashboard')

dash.delete()

return HttpResponse('Dashboard deleted')
Expand Down

0 comments on commit 561f1c3

Please sign in to comment.