Skip to content

Commit

Permalink
Merge branch 'release/3.1.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelekm committed May 19, 2022
2 parents 9e22523 + 18525a4 commit 0b3ef7d
Show file tree
Hide file tree
Showing 22 changed files with 430 additions and 484 deletions.
11 changes: 7 additions & 4 deletions python/cac_tripplanner/cac_tripplanner/publish_utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy


class PublishableMixin:
"""Helper to add Django admin actions to publish and unpublish model objects."""
actions = ('make_published', 'make_unpublished')

actions = ("make_published", "make_unpublished")

def make_published(self, request, queryset):
queryset.update(published=True)
make_published.short_description = ugettext_lazy("Publish selected %(verbose_name_plural)s")

make_published.short_description = gettext_lazy("Publish selected %(verbose_name_plural)s")

def make_unpublished(self, request, queryset):
queryset.update(published=False)
make_unpublished.short_description = ugettext_lazy("Unpublish selected %(verbose_name_plural)s")

make_unpublished.short_description = gettext_lazy("Unpublish selected %(verbose_name_plural)s")
Loading

0 comments on commit 0b3ef7d

Please sign in to comment.