fix - key error at org in quota serializer context

This commit is contained in:
2025-11-15 16:11:46 +03:30
parent ec6637569d
commit 3169298f91

View File

@@ -14,7 +14,7 @@ class QuotaSerializer(serializers.ModelSerializer):
representation = super().to_representation(instance)
# change quota weight by organization received weight
if self.context['org']:
if 'org' in self.context.keys():
quota_weight_by_org = instance.quota_amount_by_org(self.context['org'])
if quota_weight_by_org:
representation['quota_weight'] = quota_weight_by_org