Commit ee9225a0 authored by HEVELINE Thomas's avatar HEVELINE Thomas Committed by HEVELINE Thomas
Browse files

(44): reset settings

parent e6de7612
...@@ -72,9 +72,9 @@ class Item(models.Model): ...@@ -72,9 +72,9 @@ class Item(models.Model):
@property @property
def customizable(self) -> bool: def customizable(self) -> bool:
return ( return (
(self.customization is True) (self.customization is True)
or (self.option != "") or (self.option != "")
or (self.second_option != "") or (self.second_option != "")
) )
@property @property
...@@ -322,10 +322,10 @@ class OrderItemManager(models.Manager): ...@@ -322,10 +322,10 @@ class OrderItemManager(models.Manager):
def get_ordered_quantity(self, item: "Item", user) -> int: def get_ordered_quantity(self, item: "Item", user) -> int:
"""Get the total quantity ever ordered/in order by that user""" """Get the total quantity ever ordered/in order by that user"""
return ( return (
self.filter(item=item, order__user=user, order__rejected=False).aggregate( self.filter(item=item, order__user=user, order__rejected=False).aggregate(
quantity=Sum("quantity") quantity=Sum("quantity")
)["quantity"] )["quantity"]
or 0 or 0
) )
......
...@@ -26,9 +26,9 @@ SECRET_KEY = "&d3ykoj75pkdv_q^4%ens@047+qi^_^379rg#!o%zg1j=pmwi&" ...@@ -26,9 +26,9 @@ SECRET_KEY = "&d3ykoj75pkdv_q^4%ens@047+qi^_^379rg#!o%zg1j=pmwi&"
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
INTERNAL_IPS = [] INTERNAL_IPS = ["127.0.0.1"]
ALLOWED_HOSTS: List[str] = ['127.0.0.1'] ALLOWED_HOSTS: List[str] = []
# Application definition # Application definition
...@@ -101,8 +101,8 @@ DATABASES = { ...@@ -101,8 +101,8 @@ DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.mysql", "ENGINE": "django.db.backends.mysql",
"NAME": "sde", "NAME": "sde",
"USER": "fenwick", "USER": "root",
"PASSWORD": "fenwick", "PASSWORD": "",
"HOST": "127.0.0.1", "HOST": "127.0.0.1",
"PORT": 3306, "PORT": 3306,
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment