fix - key error at org in quota serializer context
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user