convert django lazy string proxies to strings in the base schema validator, rather than in the serialization code of each source model

This commit is contained in:
Gwendolyn 2023-12-11 20:49:50 +01:00
parent 4c06abd400
commit 4b1ac9f194
21 changed files with 126 additions and 104 deletions

View file

@ -416,7 +416,7 @@ class CustomLocation:
@cached_property
def grid_square(self):
return grid.get_square_for_point(self.x, self.y) or ''
return grid.get_square_for_point(self.x, self.y)
@cached_property
def title_subtitle(self):

View file

@ -17,13 +17,13 @@ def get_user_data(request):
}
if permissions:
result.update({
'title': str(_('not logged in')),
'title': _('not logged in'),
'subtitle': ngettext_lazy('%d area unlocked', '%d areas unlocked', len(permissions)) % len(permissions),
'permissions': tuple(permissions),
})
else:
result.update({
'title': str(_('Login')),
'title': _('Login'),
'subtitle': None,
'permissions': (),
})