parent
850ca382ad
commit
42bc391e57
|
@ -9,6 +9,11 @@ custom_datetime_widget = forms.DateTimeInput(
|
||||||
)
|
)
|
||||||
autofocus_input_widget = forms.TextInput(attrs={"autofocus": "autofocus"})
|
autofocus_input_widget = forms.TextInput(attrs={"autofocus": "autofocus"})
|
||||||
|
|
||||||
|
custom_date_widget = forms.DateInput(attrs={"type": "date"})
|
||||||
|
custom_datetime_widget = forms.DateTimeInput(
|
||||||
|
attrs={"type": "datetime-local"}, format="%Y-%m-%d %H:%M"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SessionForm(forms.ModelForm):
|
class SessionForm(forms.ModelForm):
|
||||||
# purchase = forms.ModelChoiceField(
|
# purchase = forms.ModelChoiceField(
|
||||||
|
@ -82,7 +87,6 @@ class PurchaseForm(forms.ModelForm):
|
||||||
widgets = {
|
widgets = {
|
||||||
"date_purchased": custom_date_widget,
|
"date_purchased": custom_date_widget,
|
||||||
"date_refunded": custom_date_widget,
|
"date_refunded": custom_date_widget,
|
||||||
"date_finished": custom_date_widget,
|
|
||||||
}
|
}
|
||||||
model = Purchase
|
model = Purchase
|
||||||
fields = [
|
fields = [
|
||||||
|
|
|
@ -155,23 +155,4 @@ if _csrf_trusted_origins:
|
||||||
else:
|
else:
|
||||||
CSRF_TRUSTED_ORIGINS = []
|
CSRF_TRUSTED_ORIGINS = []
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
USE_L10N = False
|
||||||
"DEFAULT_PERMISSION_CLASSES": [
|
|
||||||
"rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
FRONTEND_ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "frontend", "dist"))
|
|
||||||
CORS_ORIGIN_ALLOW_ALL = True
|
|
||||||
CORS_ALLOW_CREDENTIALS = True
|
|
||||||
|
|
||||||
CORS_ALLOW_HEADERS = list(default_headers) + [
|
|
||||||
"Accept-Language",
|
|
||||||
"Connection",
|
|
||||||
"Host",
|
|
||||||
"Origin",
|
|
||||||
"Referer",
|
|
||||||
"Sec-Fetch-Dest",
|
|
||||||
"Sec-Fetch-Mode",
|
|
||||||
"Sec-Fetch-Site",
|
|
||||||
]
|
|
||||||
|
|
Loading…
Reference in New Issue