mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
attachment: Add a nullable content-type.
This will be backfilled in a future commit, to prevent walking the Attachments more than once.
This commit is contained in:
committed by
Tim Abbott
parent
e29a455b2d
commit
45afdc2d35
20
zerver/migrations/0545_attachment_content_type.py
Normal file
20
zerver/migrations/0545_attachment_content_type.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("zerver", "0544_copy_avatar_images"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="archivedattachment",
|
||||
name="content_type",
|
||||
field=models.TextField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="attachment",
|
||||
name="content_type",
|
||||
field=models.TextField(null=True),
|
||||
),
|
||||
]
|
||||
@@ -683,6 +683,8 @@ class AbstractAttachment(models.Model):
|
||||
# Size of the uploaded file, in bytes
|
||||
size = models.IntegerField()
|
||||
|
||||
content_type = models.TextField(null=True)
|
||||
|
||||
# The two fields below serve as caches to let us avoid looking up
|
||||
# the corresponding messages/streams to check permissions before
|
||||
# serving these files.
|
||||
|
||||
Reference in New Issue
Block a user