chore: blacked

This commit is contained in:
2025-01-03 14:21:21 +01:00
parent 863a04737c
commit 7d021ebaa0
4 changed files with 21 additions and 19 deletions
+4 -2
View File
@@ -356,8 +356,10 @@ class Order(TimestampedModel):
default=Decimal("0"), max_digits=13, decimal_places=2, verbose_name=_("total") default=Decimal("0"), max_digits=13, decimal_places=2, verbose_name=_("total")
) )
user = models.ForeignKey(User, blank=True, null=True, on_delete=models.PROTECT, verbose_name=_("cliente")) user = models.ForeignKey(
email = models.EmailField(blank=True, verbose_name=_('e-mail')) User, blank=True, null=True, on_delete=models.PROTECT, verbose_name=_("cliente")
)
email = models.EmailField(blank=True, verbose_name=_("e-mail"))
# Datos de facturación # Datos de facturación
billing_address = models.CharField( billing_address = models.CharField(
+2 -2
View File
@@ -90,13 +90,13 @@ def create_order_from_cart(
email="", email="",
): ):
order = Order.objects.create( order = Order.objects.create(
billing_address=f'{billing_address_full_name} {billing_address_address}', billing_address=f"{billing_address_full_name} {billing_address_address}",
billing_city=billing_address_town, billing_city=billing_address_town,
billing_state=billing_address_state, billing_state=billing_address_state,
billing_country=billing_address_country, billing_country=billing_address_country,
billing_zip=billing_address_zip, billing_zip=billing_address_zip,
contact_phone=shipping_address_phone, contact_phone=shipping_address_phone,
shipping_address=f'{shipping_address_address} {shipping_address_full_name}', shipping_address=f"{shipping_address_address} {shipping_address_full_name}",
shipping_city=shipping_address_town, shipping_city=shipping_address_town,
shipping_state=shipping_address_state, shipping_state=shipping_address_state,
shipping_country=shipping_address_country, shipping_country=shipping_address_country,
+2 -2
View File
@@ -265,12 +265,12 @@
<div class="p-4"> <div class="p-4">
<input type="radio" id="shipping_method_{{ shipping_method.pk }}" name="shipping_method" <input type="radio" id="shipping_method_{{ shipping_method.pk }}" name="shipping_method"
value="{{ shipping_method.pk }}" {% if forloop.first %}checked{% endif %}> value="{{ shipping_method.pk }}" {% if forloop.first %}checked{% endif %}>
<label for="shipping_method_{{ shipping_method.pk }}"> <label for="shipping_method_{{ shipping_method.pk }}" class="text-gray-900 dark:text-white">
{{ shipping_method.name }} - {{ shipping_method.shipping_product.price.price_with_tax }}€ {{ shipping_method.name }} - {{ shipping_method.shipping_product.price.price_with_tax }}€
</label> </label>
{% if not forloop.last %} {% if not forloop.last %}
</div> </div>
<hr/> <hr class="h-px mx-4 bg-gray-200 border-0 dark:bg-gray-700"/>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
+13 -13
View File
@@ -94,20 +94,20 @@ class CartDetail(TemplateView, CreateView):
cart, created = get_or_create_cart(request) cart, created = get_or_create_cart(request)
billing_address_full_name = form.cleaned_data.get('billing_address_full_name') billing_address_full_name = form.cleaned_data.get("billing_address_full_name")
billing_address_address = form.cleaned_data.get('billing_address') billing_address_address = form.cleaned_data.get("billing_address")
billing_address_town = form.cleaned_data.get('billing_address_town') billing_address_town = form.cleaned_data.get("billing_address_town")
billing_address_state = form.cleaned_data.get('billing_address_state') billing_address_state = form.cleaned_data.get("billing_address_state")
billing_address_country = form.cleaned_data.get('billing_address_country') billing_address_country = form.cleaned_data.get("billing_address_country")
billing_address_zip = form.cleaned_data.get('billing_address_zip') billing_address_zip = form.cleaned_data.get("billing_address_zip")
shipping_address_full_name = form.cleaned_data.get('shipping_address_full_name') shipping_address_full_name = form.cleaned_data.get("shipping_address_full_name")
shipping_address_address = form.cleaned_data.get('shipping_address') shipping_address_address = form.cleaned_data.get("shipping_address")
shipping_address_town = form.cleaned_data.get('shipping_address_town') shipping_address_town = form.cleaned_data.get("shipping_address_town")
shipping_address_state = form.cleaned_data.get('shipping_address_state') shipping_address_state = form.cleaned_data.get("shipping_address_state")
shipping_address_country = form.cleaned_data.get('shipping_address_country') shipping_address_country = form.cleaned_data.get("shipping_address_country")
shipping_address_zip = form.cleaned_data.get('shipping_address_zip') shipping_address_zip = form.cleaned_data.get("shipping_address_zip")
shipping_address_phone = form.cleaned_data.get('shipping_address_phone') shipping_address_phone = form.cleaned_data.get("shipping_address_phone")
shipping_method = get_object_or_404(ShippingMethod, pk=shipping_method_id) shipping_method = get_object_or_404(ShippingMethod, pk=shipping_method_id)