Skip to content

Commit

Permalink
Merge pull request #228 from tj-django/feature/updated-description
Browse files Browse the repository at this point in the history
Update admin.py
  • Loading branch information
jackton1 committed Mar 20, 2021
2 parents 5825610 + 8c463fd commit 1660f35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ clean-build: ## Clean project build artifacts.
@rm -rf dist/
@rm -rf *.egg-info

migrate:
@$(MANAGE_PY) migrate

run: migrate
@echo "Starting server..."
@$(MANAGE_PY) runserver

test:
@echo "Running `$(PYTHON_VERSION)` test..."
@$(MANAGE_PY) test
Expand Down
7 changes: 5 additions & 2 deletions model_clone/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.contrib.admin.utils import unquote
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_lazy as _, ungettext_lazy

from model_clone import CloneMixin

Expand Down Expand Up @@ -60,7 +60,10 @@ def make_clone(self, request, queryset):
_("Successfully created: {} new duplicates".format(len(clone_obj_ids))),
)

make_clone.short_description = "Duplicate selected %(verbose_name_plural)s"
make_clone.short_description = ungettext_lazy(
"Duplicate selected %(verbose_name)s",
"Duplicate selected %(verbose_name_plural)s",
)

def _get_base_actions(self):
"""Return the list of actions, prior to any request-based filtering."""
Expand Down

0 comments on commit 1660f35

Please sign in to comment.