# 129 Handler code renaming
* renames handler code list * improves missing handler data rendering on detail view
This commit is contained in:
@@ -10,8 +10,9 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from codelist.models import KonovaCode
|
||||
from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_REGISTRATION_OFFICE_ID, \
|
||||
CODELIST_COMPENSATION_HANDLER_ID
|
||||
CODELIST_HANDLER_ID
|
||||
from konova.models import UuidModel
|
||||
from konova.utils.message_templates import UNKNOWN, NO_DETAILS
|
||||
|
||||
|
||||
class Handler(UuidModel):
|
||||
@@ -26,7 +27,7 @@ class Handler(UuidModel):
|
||||
null=True,
|
||||
blank=True,
|
||||
limit_choices_to={
|
||||
"code_lists__in": [CODELIST_COMPENSATION_HANDLER_ID],
|
||||
"code_lists__in": [CODELIST_HANDLER_ID],
|
||||
"is_selectable": True,
|
||||
"is_archived": False,
|
||||
}
|
||||
@@ -38,8 +39,8 @@ class Handler(UuidModel):
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
detail = self.detail or _("no further details")
|
||||
_type = self.type.long_name if self.type is not None else None
|
||||
detail = self.detail or NO_DETAILS
|
||||
_type = self.type.long_name if self.type is not None else UNKNOWN
|
||||
return f'{_type}, {detail}'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user