From 6c6caa3be604e74cb462440b664bcf581c1a5b2b Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Mon, 12 Feb 2024 15:17:59 +0000 Subject: [PATCH] Fix removed Django function calls ``ugettext_lazy`` and ``ungettext_lazy`` have been removed in Django v4.0 [1]. 1. https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation-removed-in-4-0 Change-Id: Iaa809aa3698bb0a32293c1de430b57f33d7e6104 --- blazar_dashboard/content/hosts/forms.py | 2 +- blazar_dashboard/content/hosts/panel.py | 2 +- blazar_dashboard/content/hosts/tables.py | 8 ++++---- blazar_dashboard/content/hosts/tabs.py | 2 +- blazar_dashboard/content/hosts/views.py | 2 +- blazar_dashboard/content/hosts/workflows.py | 2 +- blazar_dashboard/content/leases/forms.py | 2 +- blazar_dashboard/content/leases/panel.py | 2 +- blazar_dashboard/content/leases/tables.py | 8 ++++---- blazar_dashboard/content/leases/tabs.py | 2 +- blazar_dashboard/content/leases/views.py | 2 +- .../enabled/_90_admin_reservation_panelgroup.py | 2 +- .../enabled/_90_project_reservations_panelgroup.py | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/blazar_dashboard/content/hosts/forms.py b/blazar_dashboard/content/hosts/forms.py index 26da458..843d500 100644 --- a/blazar_dashboard/content/hosts/forms.py +++ b/blazar_dashboard/content/hosts/forms.py @@ -13,7 +13,7 @@ import json import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages diff --git a/blazar_dashboard/content/hosts/panel.py b/blazar_dashboard/content/hosts/panel.py index 7e8a6e8..37c47ea 100644 --- a/blazar_dashboard/content/hosts/panel.py +++ b/blazar_dashboard/content/hosts/panel.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/blazar_dashboard/content/hosts/tables.py b/blazar_dashboard/content/hosts/tables.py index 6dafcea..48d1ccf 100644 --- a/blazar_dashboard/content/hosts/tables.py +++ b/blazar_dashboard/content/hosts/tables.py @@ -11,8 +11,8 @@ # under the License. from django.template import defaultfilters as filters -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.templatetags import sizeformat @@ -42,7 +42,7 @@ class DeleteHost(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Host", u"Delete Hosts", count @@ -50,7 +50,7 @@ class DeleteHost(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Host", u"Deleted Hosts", count diff --git a/blazar_dashboard/content/hosts/tabs.py b/blazar_dashboard/content/hosts/tabs.py index d46d640..7858fa1 100644 --- a/blazar_dashboard/content/hosts/tabs.py +++ b/blazar_dashboard/content/hosts/tabs.py @@ -14,7 +14,7 @@ # under the License. from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/blazar_dashboard/content/hosts/views.py b/blazar_dashboard/content/hosts/views.py index c1b2b8c..18dad5b 100644 --- a/blazar_dashboard/content/hosts/views.py +++ b/blazar_dashboard/content/hosts/views.py @@ -11,7 +11,7 @@ # under the License. from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables diff --git a/blazar_dashboard/content/hosts/workflows.py b/blazar_dashboard/content/hosts/workflows.py index 1b3a958..7d6f493 100644 --- a/blazar_dashboard/content/hosts/workflows.py +++ b/blazar_dashboard/content/hosts/workflows.py @@ -13,7 +13,7 @@ import json import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages diff --git a/blazar_dashboard/content/leases/forms.py b/blazar_dashboard/content/leases/forms.py index 1d00864..076549c 100644 --- a/blazar_dashboard/content/leases/forms.py +++ b/blazar_dashboard/content/leases/forms.py @@ -18,7 +18,7 @@ import json import logging import re -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages diff --git a/blazar_dashboard/content/leases/panel.py b/blazar_dashboard/content/leases/panel.py index 44281aa..caedbb0 100644 --- a/blazar_dashboard/content/leases/panel.py +++ b/blazar_dashboard/content/leases/panel.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/blazar_dashboard/content/leases/tables.py b/blazar_dashboard/content/leases/tables.py index 4dc92ae..c0174e8 100644 --- a/blazar_dashboard/content/leases/tables.py +++ b/blazar_dashboard/content/leases/tables.py @@ -17,8 +17,8 @@ from datetime import datetime from functools import partial from django.template import defaultfilters as django_filters -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.utils import filters import pytz @@ -64,7 +64,7 @@ class DeleteLease(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Lease", u"Delete Leases", count @@ -72,7 +72,7 @@ class DeleteLease(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Lease", u"Deleted Leases", count diff --git a/blazar_dashboard/content/leases/tabs.py b/blazar_dashboard/content/leases/tabs.py index 9e98e2e..bf26df2 100644 --- a/blazar_dashboard/content/leases/tabs.py +++ b/blazar_dashboard/content/leases/tabs.py @@ -14,7 +14,7 @@ # under the License. from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/blazar_dashboard/content/leases/views.py b/blazar_dashboard/content/leases/views.py index d9a0dd0..f02292a 100644 --- a/blazar_dashboard/content/leases/views.py +++ b/blazar_dashboard/content/leases/views.py @@ -16,7 +16,7 @@ from django.http import JsonResponse from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables diff --git a/blazar_dashboard/enabled/_90_admin_reservation_panelgroup.py b/blazar_dashboard/enabled/_90_admin_reservation_panelgroup.py index b115509..86363fd 100644 --- a/blazar_dashboard/enabled/_90_admin_reservation_panelgroup.py +++ b/blazar_dashboard/enabled/_90_admin_reservation_panelgroup.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'reservation' diff --git a/blazar_dashboard/enabled/_90_project_reservations_panelgroup.py b/blazar_dashboard/enabled/_90_project_reservations_panelgroup.py index 19184bc..560d4c6 100644 --- a/blazar_dashboard/enabled/_90_project_reservations_panelgroup.py +++ b/blazar_dashboard/enabled/_90_project_reservations_panelgroup.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'reservations'