fix - bug of edit price features in distribution
This commit is contained in:
@@ -86,8 +86,6 @@ class QuotaStatsService:
|
||||
@staticmethod
|
||||
def update_distribution(distribution: QuotaDistribution, old_weight: int):
|
||||
diff = distribution.weight - old_weight
|
||||
if diff == 0:
|
||||
return
|
||||
|
||||
quota = distribution.quota
|
||||
|
||||
@@ -110,6 +108,14 @@ class QuotaStatsService:
|
||||
organization=assigned,
|
||||
quota=quota
|
||||
)
|
||||
|
||||
# create pricing attributes and broker pricing data
|
||||
data = json.loads(get_current_request_body().decode())
|
||||
import_price_features(data, assigned_stat, quota)
|
||||
|
||||
if diff == 0:
|
||||
return
|
||||
|
||||
if assigner_stat.stat_type == 'distribution':
|
||||
# if diff > 0 it is added to destination
|
||||
assigner_stat.remaining_amount -= diff
|
||||
@@ -119,10 +125,6 @@ class QuotaStatsService:
|
||||
assigned_stat.remaining_amount += diff
|
||||
assigned_stat.save()
|
||||
|
||||
# create pricing attributes and broker pricing data
|
||||
data = json.loads(get_current_request_body().decode())
|
||||
import_price_features(data, assigned_stat, quota)
|
||||
|
||||
@staticmethod
|
||||
def delete_distribution(distribution: QuotaDistribution):
|
||||
quota = distribution.quota
|
||||
|
||||
Reference in New Issue
Block a user