mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
models: Add type annotation for CTEManager.
mypy_django_plugin cannot resolve the type of the custom manager. We add a type annotation explicitly to skip the type inferrence. This fixes the following error: error: Could not resolve manager type for "zerver.models.UserGroup.objects" [django-manager-missing] Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
95d12749c0
commit
92c4e5b75c
@@ -2132,7 +2132,7 @@ class PasswordTooWeakError(Exception):
|
||||
|
||||
|
||||
class UserGroup(models.Model):
|
||||
objects = CTEManager()
|
||||
objects: CTEManager = CTEManager()
|
||||
id: int = models.AutoField(auto_created=True, primary_key=True, verbose_name="ID")
|
||||
name: str = models.CharField(max_length=100)
|
||||
direct_members: Manager = models.ManyToManyField(
|
||||
|
||||
Reference in New Issue
Block a user