diff --git a/zerver/models.py b/zerver/models.py index b6a0c9c01a..6a24ef7ce3 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -2353,12 +2353,12 @@ class UserGroup(models.Model): # type: ignore[django-manager-missing] # django- objects: CTEManager = CTEManager() name = models.CharField(max_length=MAX_NAME_LENGTH) direct_members = models.ManyToManyField( - UserProfile, through="UserGroupMembership", related_name="direct_groups" + UserProfile, through="zerver.UserGroupMembership", related_name="direct_groups" ) direct_subgroups = models.ManyToManyField( "self", symmetrical=False, - through="GroupGroupMembership", + through="zerver.GroupGroupMembership", through_fields=("supergroup", "subgroup"), related_name="direct_supergroups", ) @@ -2501,7 +2501,7 @@ class PreregistrationUser(models.Model): full_name = models.CharField(max_length=UserProfile.MAX_NAME_LENGTH, null=True) full_name_validated = models.BooleanField(default=False) referred_by = models.ForeignKey(UserProfile, null=True, on_delete=CASCADE) - streams = models.ManyToManyField("Stream") + streams = models.ManyToManyField("zerver.Stream") invited_at = models.DateTimeField(auto_now=True) realm_creation = models.BooleanField(default=False) # Indicates whether the user needs a password. Users who were @@ -2571,7 +2571,7 @@ def filter_to_valid_prereg_users( class MultiuseInvite(models.Model): referred_by = models.ForeignKey(UserProfile, on_delete=CASCADE) - streams = models.ManyToManyField("Stream") + streams = models.ManyToManyField("zerver.Stream") realm = models.ForeignKey(Realm, on_delete=CASCADE) invited_as = models.PositiveSmallIntegerField(default=PreregistrationUser.INVITE_AS["MEMBER"]) @@ -3792,7 +3792,7 @@ class Attachment(AbstractAttachment): # This is only present for Attachment and not ArchiveAttachment. # because ScheduledMessage is not subject to archiving. - scheduled_messages = models.ManyToManyField("ScheduledMessage") + scheduled_messages = models.ManyToManyField("zerver.ScheduledMessage") def is_claimed(self) -> bool: return self.messages.exists() or self.scheduled_messages.exists() @@ -4441,7 +4441,7 @@ class DefaultStreamGroup(models.Model): name = models.CharField(max_length=MAX_NAME_LENGTH, db_index=True) realm = models.ForeignKey(Realm, on_delete=CASCADE) - streams = models.ManyToManyField("Stream") + streams = models.ManyToManyField("zerver.Stream") description = models.CharField(max_length=1024, default="") class Meta: