fix: docker build
This commit is contained in:
+3
-1
@@ -43,4 +43,6 @@ class StylingMixin:
|
||||
field.widget.attrs.update({'class': ' '.join(self.classes)})
|
||||
|
||||
if self.placeholder_for_field.get(field_name):
|
||||
field.widget.attrs.update({'placeholder': self.placeholder_for_field.get(field_name)})
|
||||
field.widget.attrs.update({
|
||||
'placeholder': self.placeholder_for_field.get(field_name),
|
||||
})
|
||||
|
||||
@@ -52,8 +52,6 @@
|
||||
--leading-tight: 1.25;
|
||||
--radius-md: 0.375rem;
|
||||
--radius-lg: 0.5rem;
|
||||
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
||||
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
--animate-spin: spin 1s linear infinite;
|
||||
--default-transition-duration: 150ms;
|
||||
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
+16
-7
@@ -10,7 +10,10 @@ from django.views.generic import TemplateView
|
||||
|
||||
from config.mixins import HTMXFormComponent
|
||||
from shop.filters import ProductFilter
|
||||
from shop.models import CartItem, CustomerAddress, Product, ProductPrice, ShippingMethod, WishlistedProduct
|
||||
from shop.models import (
|
||||
CartItem, CustomerAddress, Product, ProductPrice,
|
||||
ShippingMethod, WishlistedProduct,
|
||||
)
|
||||
from users.forms.change_password import ChangePasswordForm
|
||||
from users.forms.info import UserInfoForm
|
||||
from web.forms import CustomerAddressForm
|
||||
@@ -140,7 +143,11 @@ class UserInfoFormComponentView(HTMXFormComponent):
|
||||
return reverse('web:user_info_component')
|
||||
|
||||
def get_initial_values(self, instance):
|
||||
return {'email': instance.email, 'first_name': instance.first_name, 'last_name': instance.last_name}
|
||||
return {
|
||||
'email': instance.email,
|
||||
'first_name': instance.first_name,
|
||||
'last_name': instance.last_name
|
||||
}
|
||||
|
||||
|
||||
class ChangePasswordFormComponentView(HTMXFormComponent):
|
||||
@@ -165,18 +172,20 @@ class ListCustomerAddressComponent(TemplateView):
|
||||
template_name = 'components/users/retrieve_update_address.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return {'customer_addresses': CustomerAddress.objects.filter(user=self.request.user)}
|
||||
return {
|
||||
'customer_addresses': CustomerAddress.objects.filter(user=self.request.user)
|
||||
}
|
||||
|
||||
|
||||
def update_customer_address(request, pk):
|
||||
customer_address = get_object_or_404(CustomerAddress, pk=pk, user=request.user)
|
||||
form = CustomerAddressForm(request.POST, instance=customer_address)
|
||||
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return HttpResponse(status=200, headers={'HX-Trigger': 'updated_addresses'})
|
||||
if not form.is_valid():
|
||||
return HttpResponse(form.errors, status=400)
|
||||
|
||||
return HttpResponse(form.errors, status=400)
|
||||
form.save()
|
||||
return HttpResponse(status=200, headers={'HX-Trigger': 'updated_addresses'})
|
||||
|
||||
|
||||
list_products = ListProducts.as_view()
|
||||
|
||||
Reference in New Issue
Block a user