Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Move emojiset_choices method to UserBaseSettings class.

Sahil Batra307b55e93d84
diff --git a/zerver/models.py b/zerver/models.py
index 94c4ea5b6d1..22189981d65 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -1406,6 +1406,12 @@ class UserBaseSettings(models.Model):
class Meta:
abstract = True
+ @staticmethod
+ def emojiset_choices() -> List[Dict[str, str]]:
+ return [
+ dict(key=emojiset[0], text=emojiset[1]) for emojiset in UserProfile.EMOJISET_CHOICES
+ ]
+
class RealmUserDefault(UserBaseSettings):
"""This table stores realm-level default values for user preferences
@@ -1741,12 +1747,6 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
allowed_bot_types.append(UserProfile.EMBEDDED_BOT)
return allowed_bot_types
- @staticmethod
- def emojiset_choices() -> List[Dict[str, str]]:
- return [
- dict(key=emojiset[0], text=emojiset[1]) for emojiset in UserProfile.EMOJISET_CHOICES
- ]
-
def email_address_is_realm_public(self) -> bool:
if self.realm.email_address_visibility == Realm.EMAIL_ADDRESS_VISIBILITY_EVERYONE:
return True