ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: filestorage upload и preview вложений
This commit is contained in:
@@ -192,6 +192,7 @@ class DynamicBaseSerializer(BaseSerializer):
|
||||
issue_attachments = FileAsset.objects.filter(
|
||||
issue_id=issue_id,
|
||||
entity_type=FileAsset.EntityTypeContext.ISSUE_ATTACHMENT,
|
||||
is_uploaded=True,
|
||||
)
|
||||
# Serialize issue_attachments and add them to the response
|
||||
response["issue_attachments"] = IssueAttachmentLiteSerializer(issue_attachments, many=True).data
|
||||
|
||||
@@ -61,6 +61,11 @@ class WorkSpaceSerializer(DynamicBaseSerializer):
|
||||
)
|
||||
return value
|
||||
|
||||
def validate_storage_file_size_limit(self, value):
|
||||
if value is not None and int(value) < 1:
|
||||
raise serializers.ValidationError("Storage file size limit must be greater than zero")
|
||||
return value
|
||||
|
||||
class Meta:
|
||||
model = Workspace
|
||||
fields = "__all__"
|
||||
|
||||
Reference in New Issue
Block a user