Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlhengstmengel committed Oct 2, 2024
1 parent 4258041 commit 9348e26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
27 changes: 6 additions & 21 deletions integreat_cms/cms/views/contacts/contact_bulk_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@

from django.contrib import messages
from django.http import Http404
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from django.views.generic.list import MultipleObjectMixin

from ...models import Contact
from ...utils.stringify_list import iter_to_string
from ...utils.translation_utils import gettext_many_lazy as __
from ..bulk_action_views import BulkActionView

if TYPE_CHECKING:
from typing import Any

from django.http import HttpRequest, HttpResponse
from django.http.response import HttpResponseRedirect

logger = logging.getLogger(__name__)

Expand All @@ -28,6 +25,9 @@ class ContactBulkAction(BulkActionView):
Class to overwrite get_queryset()
"""

#: The model of this :class:`~integreat_cms.cms.views.bulk_action_views.BulkActionView`
model = Contact

def get_queryset(self) -> Any:
r"""
This method overrides get_queryset from BulkActionView to handle the relation between contact and poi
Expand All @@ -51,18 +51,7 @@ def get_queryset(self) -> Any:
return queryset


class ContactBulkActionMixin(MultipleObjectMixin):
"""
Mixin for contact bulk actions
"""

#: The model of this :class:`~integreat_cms.cms.views.bulk_action_views.BulkActionView`
model = Contact


class ArchiveContactBulkAction(
ContactBulkActionMixin, ContactBulkAction
): # pylint: disable=too-many-ancestors
class ArchiveContactBulkAction(ContactBulkAction): # pylint: disable=too-many-ancestors
"""
Bulk action to archive multiple contacts at once
"""
Expand Down Expand Up @@ -100,9 +89,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return super().post(request, *args, **kwargs)


class RestoreContactBulkAction(
ContactBulkActionMixin, ContactBulkAction
): # pylint: disable=too-many-ancestors
class RestoreContactBulkAction(ContactBulkAction): # pylint: disable=too-many-ancestors
"""
Bulk action to restore multiple contacts at once
"""
Expand Down Expand Up @@ -138,9 +125,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return super().post(request, *args, **kwargs)


class DeleteContactBulkAction(
ContactBulkActionMixin, ContactBulkAction
): # pylint: disable=too-many-ancestors
class DeleteContactBulkAction(ContactBulkAction): # pylint: disable=too-many-ancestors
"""
Bulk action to delete multiple contacts at once
"""
Expand Down
2 changes: 0 additions & 2 deletions integreat_cms/release_notes/current/unreleased/2954.yml

This file was deleted.

0 comments on commit 9348e26

Please sign in to comment.