Skip to content

Commit

Permalink
fix: ugettext导入修改为gettext TencentBlueKing#1464
Browse files Browse the repository at this point in the history
  • Loading branch information
huangpixu committed Jan 3, 2025
1 parent db56b2e commit cdc09b8
Show file tree
Hide file tree
Showing 141 changed files with 3,265 additions and 1,737 deletions.
4 changes: 2 additions & 2 deletions iam/contrib/django/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from django.http.response import JsonResponse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from iam.contrib.http import HTTP_AUTH_FORBIDDEN_CODE

Expand All @@ -26,5 +26,5 @@ def __init__(self, exc, *args, **kwargs):
"data": None,
"permission": exc.perms_apply_data(),
}
kwargs['status'] = kwargs.get("status", 499)
kwargs["status"] = kwargs.get("status", 499)
super(IAMAuthFailedResponse, self).__init__(*args, **kwargs)
2 changes: 1 addition & 1 deletion itsm/auth_iam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"""

from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from itsm.component.constants import LEN_NORMAL

Expand Down
23 changes: 19 additions & 4 deletions itsm/component/constants/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from calendar import FRIDAY, MONDAY, SATURDAY, SUNDAY, THURSDAY, TUESDAY, WEDNESDAY

from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from itsm.component.utils.basic import choices_to_namedtuple, tuple_choices

Expand Down Expand Up @@ -240,7 +240,12 @@ def update(self, **kwargs):
"source": "ticket",
"type": "STRING",
},
{"key": "ticket_creator", "name": _("提单人"), "source": "ticket", "type": "MEMBER"},
{
"key": "ticket_creator",
"name": _("提单人"),
"source": "ticket",
"type": "MEMBER",
},
{
"key": "ticket_create_at",
"name": _("提单时间"),
Expand Down Expand Up @@ -302,8 +307,18 @@ def update(self, **kwargs):
"source": "task",
"type": "STRING",
},
{"key": "task_creator", "name": _("任务创建人"), "source": "task", "type": "MEMBER"},
{"key": "task_operator", "name": _("任务处理人"), "source": "task", "type": "MEMBER"},
{
"key": "task_creator",
"name": _("任务创建人"),
"source": "task",
"type": "MEMBER",
},
{
"key": "task_operator",
"name": _("任务处理人"),
"source": "task",
"type": "MEMBER",
},
{
"key": "task_create_at",
"name": _("任务创建时间"),
Expand Down
Loading

0 comments on commit cdc09b8

Please sign in to comment.