We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d24532d commit bd71ca9Copy full SHA for bd71ca9
apps/knowledge/serializers/document.py
@@ -590,11 +590,12 @@ class Split(serializers.Serializer):
590
def is_valid(self, *, instance=None, raise_exception=True):
591
super().is_valid(raise_exception=True)
592
files = instance.get('file')
593
+ knowledge = Knowledge.objects.filter(id=self.data.get('knowledge_id')).first()
594
for f in files:
- if f.size > 1024 * 1024 * 100:
595
+ if f.size > 1024 * 1024 * knowledge.file_size_limit:
596
raise AppApiException(500, _(
597
'The maximum size of the uploaded file cannot exceed {}MB'
- ).format(100))
598
+ ).format(knowledge.file_size_limit))
599
600
def parse(self, instance):
601
self.is_valid(instance=instance, raise_exception=True)
0 commit comments