From 9d26c78ecefe77fe4b7fc80eda1012f99d3407b5 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sun, 25 Mar 2018 01:09:52 +0000 Subject: [PATCH] mypy: Annotate last null=true in models.py; modify mypy.ini exclusions. --- mypy.ini | 2 ++ zerver/models.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 4bec504458..80ce282e7d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -73,6 +73,8 @@ strict_optional = False strict_optional = False [mypy-zerver.lib.bugdown.api_arguments_table_generator] #18: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "items" strict_optional = False +[mypy-zerver.lib.message] #868: error: Unsupported operand types for - ("Optional[int]" and "int") +strict_optional = False [mypy-zerver.migrations.0077_add_file_name_field_to_realm_emoji] #73: error: Argument 2 to "upload_files" of "Uploader" has incompatible type "Optional[bytes]"; expected "bytes" strict_optional = False diff --git a/zerver/models.py b/zerver/models.py index 1ecb9f5170..8ffd66931f 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -188,7 +188,7 @@ class Realm(models.Model): default=2**31 - 1) # type: BitHandler waiting_period_threshold = models.PositiveIntegerField(default=0) # type: int _max_invites = models.IntegerField(null=True, db_column='max_invites') # type: Optional[int] - message_visibility_limit = models.IntegerField(null=True) # type: int + message_visibility_limit = models.IntegerField(null=True) # type: Optional[int] # See upload_quota_bytes; don't interpret upload_quota_gb directly. upload_quota_gb = models.IntegerField(null=True) # type: Optional[int]