From 5296206c42f6b83cbee1904c337aa4992c2da12a Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Mon, 17 Jun 2024 22:37:26 +0200 Subject: [PATCH] Add: meta and str func to UserProfile model --- archivist/apps/user/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/archivist/apps/user/models.py b/archivist/apps/user/models.py index 17dbad8..aa38504 100644 --- a/archivist/apps/user/models.py +++ b/archivist/apps/user/models.py @@ -4,6 +4,7 @@ from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver +from django.utils.translation import gettext_lazy as _ from sites.furaffinity.models import FA_Submission @@ -18,6 +19,13 @@ class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True, unique=True) show_mature = models.CharField(max_length=2, choices=MATURE, default=MATURE[0][0]) + class Meta: + verbose_name = _("User Profile") + verbose_name_plural = _("User Profiles") + + def __str__(self): + return self.user.username + class SeenPost(models.Model): user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)