Fix admin API gaps for users, exchange checks, and parser logs

This commit is contained in:
2026-03-19 16:48:38 +01:00
parent 25176f31b4
commit 941c268d32
22 changed files with 817 additions and 28 deletions

View File

@@ -72,6 +72,13 @@ class Profile(models.Model):
first_name = models.CharField(_("first name"), max_length=50, blank=True, null=True)
middle_name = models.CharField(
_("middle name"),
max_length=50,
blank=True,
null=True,
)
last_name = models.CharField(_("last name"), max_length=50, blank=True, null=True)
bio = models.TextField(
@@ -104,10 +111,8 @@ class Profile(models.Model):
@property
def full_name(self):
"""Полное имя пользователя"""
if self.first_name and self.last_name:
return f"{self.first_name} {self.last_name}"
elif self.first_name:
return self.first_name
elif self.last_name:
return self.last_name
parts = [self.first_name, self.middle_name, self.last_name]
full_name = " ".join(part for part in parts if part)
if full_name:
return full_name
return self.user.username