mypy: Annotate last null=true in models.py; modify mypy.ini exclusions.

This commit is contained in:
neiljp (Neil Pilgrim)
2018-03-25 01:09:52 +00:00
committed by Tim Abbott
parent 1416c9f0c9
commit 9d26c78ece
2 changed files with 3 additions and 1 deletions

View File

@@ -73,6 +73,8 @@ strict_optional = False
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" [mypy-zerver.lib.bugdown.api_arguments_table_generator] #18: error: Item "None" of "Optional[Dict[str, Any]]" has no attribute "items"
strict_optional = False 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" [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 strict_optional = False

View File

@@ -188,7 +188,7 @@ class Realm(models.Model):
default=2**31 - 1) # type: BitHandler default=2**31 - 1) # type: BitHandler
waiting_period_threshold = models.PositiveIntegerField(default=0) # type: int waiting_period_threshold = models.PositiveIntegerField(default=0) # type: int
_max_invites = models.IntegerField(null=True, db_column='max_invites') # type: Optional[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. # See upload_quota_bytes; don't interpret upload_quota_gb directly.
upload_quota_gb = models.IntegerField(null=True) # type: Optional[int] upload_quota_gb = models.IntegerField(null=True) # type: Optional[int]