diff --git a/ecommerce/extensions/api/v2/views/coupons.py b/ecommerce/extensions/api/v2/views/coupons.py index e46c95cb324..d42499ee0e8 100644 --- a/ecommerce/extensions/api/v2/views/coupons.py +++ b/ecommerce/extensions/api/v2/views/coupons.py @@ -376,12 +376,11 @@ def update_voucher_data(self, request_data, vouchers): if data: if 'name' in data: + data.pop('name') for voucher in vouchers: - voucher_data = data.copy() - voucher_data['name'] = "%s - %d" % (voucher_data['name'], voucher.id + 1) - voucher.save(**voucher_data) - else: - vouchers.update(**data) + voucher.name = "%s - %d" % (data['name'], voucher.id + 1) + + vouchers.update(**data) def create_update_data_dict(self, data, fields): """