Removed total and price fields used in dcl flow

This commit is contained in:
PCoder 2017-09-23 13:21:01 +05:30
parent 0bc2b22f62
commit 93d36306fb
3 changed files with 2 additions and 5 deletions

View file

@ -156,9 +156,7 @@
function _calcPricing() { function _calcPricing() {
var total = (cardPricing['cpu'].value * 5) + (2 * cardPricing['ram'].value) + (0.6 * cardPricing['storage'].value); var total = (cardPricing['cpu'].value * 5) + (2 * cardPricing['ram'].value) + (0.6 * cardPricing['storage'].value);
total = parseFloat(total.toFixed(2)); total = parseFloat(total.toFixed(2));
$("#total").text(total); $("#total").text(total);
$('input[name=total]').val(total);
} }
function form_success() { function form_success() {

View file

@ -77,7 +77,6 @@
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
<input type="hidden" name="total">
<!--<div class="description check-ip"> <!--<div class="description check-ip">
<input type="checkbox" name="ipv6"> Ipv6 Only<br> <input type="checkbox" name="ipv6"> Ipv6 Only<br>
</div>--> </div>-->

View file

@ -275,7 +275,6 @@ class IndexView(CreateView):
memory_field = forms.IntegerField(validators=[self.validate_memory]) memory_field = forms.IntegerField(validators=[self.validate_memory])
storage = request.POST.get('storage') storage = request.POST.get('storage')
storage_field = forms.IntegerField(validators=[self.validate_storage]) storage_field = forms.IntegerField(validators=[self.validate_storage])
price = request.POST.get('total')
template_id = int(request.POST.get('config')) template_id = int(request.POST.get('config'))
template = VMTemplate.objects.filter( template = VMTemplate.objects.filter(
opennebula_vm_template_id=template_id).first() opennebula_vm_template_id=template_id).first()
@ -534,6 +533,7 @@ class OrderConfirmationView(DetailView):
disk_size = specs.get('disk_size') disk_size = specs.get('disk_size')
amount_to_be_charged = get_vm_price(cpu=cpu, memory=memory, amount_to_be_charged = get_vm_price(cpu=cpu, memory=memory,
disk_size=disk_size) disk_size=disk_size)
specs['price'] = amount_to_be_charged
plan_name = StripeUtils.get_stripe_plan_name(cpu=cpu, plan_name = StripeUtils.get_stripe_plan_name(cpu=cpu,
memory=memory, memory=memory,
disk_size=disk_size) disk_size=disk_size)