Skip to content

Commit

Permalink
Add success messages for Organization views (#11480)
Browse files Browse the repository at this point in the history
* Add success messages for Organization views

Missed these in my last PR doing success messages.

* Update readthedocs/organizations/views/private.py
  • Loading branch information
ericholscher authored Sep 10, 2024
1 parent 2f48c81 commit b725eb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions readthedocs/organizations/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dispatch(self, *args, **kwargs):


# Mixins
class OrganizationMixin(CheckOrganizationsEnabled):
class OrganizationMixin(SuccessMessageMixin, CheckOrganizationsEnabled):

"""
Mixin class that provides organization sublevel objects.
Expand Down Expand Up @@ -132,7 +132,7 @@ def get_form(self, data=None, files=None, **kwargs):


# Base views
class OrganizationView(CheckOrganizationsEnabled):
class OrganizationView(SuccessMessageMixin, CheckOrganizationsEnabled):

"""Mixin for an organization view that doesn't have nested components."""

Expand Down Expand Up @@ -168,7 +168,7 @@ def get_success_url(self):
)


class OrganizationOwnerView(SuccessMessageMixin, OrganizationMixin):
class OrganizationOwnerView(OrganizationMixin):

"""Mixin for views related to organization owners."""

Expand Down Expand Up @@ -209,7 +209,7 @@ def get_success_url(self):
)


class OrganizationTeamView(SuccessMessageMixin, OrganizationTeamMixin):
class OrganizationTeamView(OrganizationTeamMixin):

"""Mixin for views related to organization teams."""

Expand All @@ -232,7 +232,7 @@ def get_success_url(self):
)


class OrganizationTeamMemberView(SuccessMessageMixin, OrganizationTeamMixin):
class OrganizationTeamMemberView(OrganizationTeamMixin):

"""Mixin for views related to organization team members."""

Expand Down
2 changes: 2 additions & 0 deletions readthedocs/organizations/views/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class EditOrganization(
UpdateView,
):
template_name = "organizations/admin/organization_edit.html"
success_message = _("Organization updated")


class DeleteOrganization(
Expand All @@ -126,6 +127,7 @@ class DeleteOrganization(
DeleteViewWithMessage,
):
template_name = "organizations/admin/organization_delete.html"
success_message = _("Organization deleted")

def get_success_url(self):
return reverse_lazy("organization_list")
Expand Down

0 comments on commit b725eb4

Please sign in to comment.