This commit is contained in:
some weird guy
2023-10-19 16:16:35 -07:00
parent bb7e453ed4
commit 3d9be1f95f
9 changed files with 116 additions and 62 deletions
+5 -1
View File
@@ -57,7 +57,7 @@ class UserManager(BaseUserManager):
profile.origin_info = json.dumps(nn)
user.avatar_type = 2
else:
user.avatar_input = util.get_gravatar(email) or ('s' if getrandbits(1) else '')
user.avatar_input = util.get_gravatar(email) or None
user.avatar_type = 1
user.set_password(password)
@@ -242,6 +242,10 @@ class User(AbstractBaseUser, PermissionsMixin):
return int(limit) - recent_posts
def get_class(self):
if self.banned() or not self.is_active:
first = settings.STATIC_URL + "img/banned.svg"
second = "Banned"
return [first, second]
if not self.role:
return [None, None]
second = self.role.organization