Skip to content

Commit

Permalink
models: Include explicit app name in ManyToManyField reference strings.
Browse files Browse the repository at this point in the history
typeddjango/django-stubs#1802

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored and akarsh-jain-790 committed Nov 27, 2023
1 parent 3c282f2 commit 222bdd4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions zerver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2361,12 +2361,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",
)
Expand Down Expand Up @@ -2509,7 +2509,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
Expand Down Expand Up @@ -2579,7 +2579,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"])

Expand Down Expand Up @@ -3800,7 +3800,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()
Expand Down Expand Up @@ -4449,7 +4449,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:
Expand Down

0 comments on commit 222bdd4

Please sign in to comment.