fix - add org quota stat in attributes & brokers on quota create
This commit is contained in:
2
.idea/Rasaddam_Backend.iml
generated
2
.idea/Rasaddam_Backend.iml
generated
@@ -14,7 +14,7 @@
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.9 (dam_env)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.10 (env)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.10 (env)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (dam_env)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (env)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@@ -87,7 +87,7 @@ class QuotaViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, DynamicS
|
||||
attributes_value_list = []
|
||||
if 'price_attributes_data' in request.data.keys():
|
||||
for attr in request.data['price_attributes_data']:
|
||||
attr.update({'quota': quota.id})
|
||||
attr.update({'quota': quota.id, 'org_quota_stat': quota.org_quota_stats.all().first().id})
|
||||
attributes = CustomOperations().custom_create(
|
||||
request=request,
|
||||
view=product_api.AttributeValueViewSet(),
|
||||
@@ -99,7 +99,7 @@ class QuotaViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, DynamicS
|
||||
broker_data_list = []
|
||||
if 'broker_data' in request.data.keys():
|
||||
for broker in request.data['broker_data']:
|
||||
broker.update({'quota': quota.id})
|
||||
broker.update({'quota': quota.id, 'org_quota_stat': quota.org_quota_stats.all().first().id})
|
||||
broker_value = CustomOperations().custom_create(
|
||||
request=request,
|
||||
view=QuotaBrokerValueViewSet(),
|
||||
|
||||
Reference in New Issue
Block a user