minor fixes, disabled mailing temporarily

pull/2/head
mtyton 2023-06-08 01:39:06 +02:00
rodzic d2b3cf486c
commit 486c575cb4
4 zmienionych plików z 17 dodań i 6 usunięć

Wyświetl plik

@ -35,6 +35,12 @@ class ProductAdmin(ModelAdmin):
list_display = ("title", "price")
class DocumentTemplateAdmin(ModelAdmin):
model = models.DocumentTemplate
list_display = ("name", "doc_type")
class StoreAdminGroup(ModelAdminGroup):
menu_label = "Store"
menu_icon = 'folder-open-inverse'
@ -44,7 +50,8 @@ class StoreAdminGroup(ModelAdminGroup):
ProductCategoryAdmin,
ProductCategoryParamAdmin,
ProductTemplateAdmin,
ProductAdmin
ProductAdmin,
DocumentTemplateAdmin
)

Wyświetl plik

@ -187,7 +187,7 @@ class CustomerData(models.Model):
class OrderProductManager(models.Manager):
def create_from_cart(self, cart, order):
for item in cart:
for item in cart.get_items():
self.create(
product=item.product,
order=order,
@ -222,8 +222,8 @@ class OrderManager(models.Manager):
order=order,
template=receipt_template
)
send_mail(agreement)
send_mail(receipt)
#send_mail(agreement)
#send_mail(receipt)
return order
@ -249,7 +249,7 @@ class DocumentTemplate(models.Model):
name = models.CharField(max_length=255)
file = models.FileField(upload_to="documents")
doc_type = models.CharField(max_length=255, choices=DocumentTypeChoices.choices)
created_at = models.DateTimeField(auto_now_add=True)
created_at = models.DateTimeField(auto_now_add=True, null=True)
def __str__(self):
return self.name

Wyświetl plik

@ -65,7 +65,10 @@
<h5 class="fw-normal mb-0 text-black">To Pay: {{cart.total_price}}</h5>
</div>
<div class="col-sm-6 text-end">
<a href="" class="btn btn-success btn-block btn-lg">Confirm</a>
<form action="" method="POST">
{% csrf_token %}
<input type="submit" class="btn btn-success btn-block btn-lg" value="Confirm">
</form>
</div>
</div>

Wyświetl plik

@ -139,6 +139,7 @@ class OrderConfirmView(View):
cart, customer_data
)
self.request.session.pop("customer_data_id")
cart.clear()
# TODO - messages
return HttpResponseRedirect(reverse("cart"))