From 3293eec240a0a2c7bfd8116d75484794d3a6210e Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 14 Jul 2020 23:04:27 +0200 Subject: Removes django_crispy_bulma dependency. --- pydis_site/apps/home/forms/account_deletion.py | 7 +++---- pydis_site/settings.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/forms/account_deletion.py b/pydis_site/apps/home/forms/account_deletion.py index 17ffe5c1..9498a341 100644 --- a/pydis_site/apps/home/forms/account_deletion.py +++ b/pydis_site/apps/home/forms/account_deletion.py @@ -1,7 +1,6 @@ from crispy_forms.helper import FormHelper -from crispy_forms.layout import Layout +from crispy_forms.layout import Layout, Submit, Field from django.forms import CharField, Form -from django_crispy_bulma.layout import IconField, Submit class AccountDeletionForm(Form): @@ -12,10 +11,10 @@ class AccountDeletionForm(Form): self.helper = FormHelper() self.helper.form_method = "post" - self.helper.add_input(Submit("submit", "I understand, delete my account")) + self.helper.add_input(Submit("submit", "I understand, delete my account", css_class='button is-primary')) self.helper.layout = Layout( - IconField("username", icon_prepend="user") + Field("username") ) username = CharField( diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 5f80a414..4487a9d3 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -52,6 +52,8 @@ if DEBUG: 'api.pythondiscord.local', 'admin.pythondiscord.local', 'staff.pythondiscord.local', + '0.0.0.0', + 'localhost', 'web', 'api.web', 'admin.web', @@ -105,7 +107,6 @@ INSTALLED_APPS = [ 'allauth.socialaccount.providers.github', 'crispy_forms', - 'django_crispy_bulma', 'django_hosts', 'django_filters', 'django_nyt.apps.DjangoNytConfig', -- cgit v1.2.3 From 11503b660d2a4249edde02a50889ebae270f07f4 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 15 Jul 2020 00:06:25 +0200 Subject: Removes django_crispy_forms dependency, too. --- Pipfile | 1 - Pipfile.lock | 10 +--------- pydis_site/apps/home/forms/account_deletion.py | 14 -------------- pydis_site/settings.py | 13 ------------- pydis_site/templates/home/account/delete.html | 9 ++++++--- 5 files changed, 7 insertions(+), 40 deletions(-) (limited to 'pydis_site') diff --git a/Pipfile b/Pipfile index 0f8872ea..ab77e824 100644 --- a/Pipfile +++ b/Pipfile @@ -5,7 +5,6 @@ verify_ssl = true [packages] django = "~=2.2.13" -django-crispy-forms = "~=1.7.2" django-environ = "~=0.4.5" django-filter = "~=2.1.0" django-hosts = "~=3.0" diff --git a/Pipfile.lock b/Pipfile.lock index 3d35f4c3..3166b224 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "809dbb7f9b5383ead59aa1706b755eb60149cc9c1160c8516f2d4f54a193a482" + "sha256": "009be40262ffc13460a05cefe0e66c41c4c14ed9ea7aca9854ae7bddeeba5da9" }, "pipfile-spec": 6, "requires": { @@ -65,14 +65,6 @@ ], "version": "==1.0.0" }, - "django-crispy-forms": { - "hashes": [ - "sha256:5952bab971110d0b86c278132dae0aa095beee8f723e625c3d3fa28888f1675f", - "sha256:705ededc554ad8736157c666681165fe22ead2dec0d5446d65fc9dd976a5a876" - ], - "index": "pypi", - "version": "==1.7.2" - }, "django-environ": { "hashes": [ "sha256:6c9d87660142608f63ec7d5ce5564c49b603ea8ff25da595fd6098f6dc82afde", diff --git a/pydis_site/apps/home/forms/account_deletion.py b/pydis_site/apps/home/forms/account_deletion.py index 9498a341..b2160657 100644 --- a/pydis_site/apps/home/forms/account_deletion.py +++ b/pydis_site/apps/home/forms/account_deletion.py @@ -1,22 +1,8 @@ -from crispy_forms.helper import FormHelper -from crispy_forms.layout import Layout, Submit, Field from django.forms import CharField, Form class AccountDeletionForm(Form): """Account deletion form, to collect username for confirmation of removal.""" - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.helper = FormHelper() - - self.helper.form_method = "post" - self.helper.add_input(Submit("submit", "I understand, delete my account", css_class='button is-primary')) - - self.helper.layout = Layout( - Field("username") - ) - username = CharField( label="Username", required=True diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 4487a9d3..206bec7d 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -106,7 +106,6 @@ INSTALLED_APPS = [ 'allauth.socialaccount.providers.discord', 'allauth.socialaccount.providers.github', - 'crispy_forms', 'django_hosts', 'django_filters', 'django_nyt.apps.DjangoNytConfig', @@ -289,7 +288,6 @@ LOGGING = { } # Django Messages framework config - MESSAGE_TAGS = { messages.DEBUG: 'primary', messages.INFO: 'info', @@ -298,17 +296,6 @@ MESSAGE_TAGS = { messages.ERROR: 'danger', } -# Custom settings for Crispyforms -CRISPY_ALLOWED_TEMPLATE_PACKS = ( - "bootstrap", - "uni_form", - "bootstrap3", - "bootstrap4", - "bulma", -) - -CRISPY_TEMPLATE_PACK = "bulma" - # Custom settings for django-simple-bulma BULMA_SETTINGS = { "variables": { # If you update these colours, please update the notification.css file diff --git a/pydis_site/templates/home/account/delete.html b/pydis_site/templates/home/account/delete.html index 1020a82b..0d44e32a 100644 --- a/pydis_site/templates/home/account/delete.html +++ b/pydis_site/templates/home/account/delete.html @@ -1,6 +1,4 @@ {% extends 'base/base.html' %} - -{% load crispy_forms_tags %} {% load static %} {% block title %}Delete Account{% endblock %} @@ -36,7 +34,12 @@
- {% crispy form %} +
+ {% csrf_token %} + + + +
-- cgit v1.2.3 From 4df7239adb60114f833e5c22eacff726b61e1d5a Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 15 Jul 2020 00:11:51 +0200 Subject: Fix linting issues caused by refactor. --- pydis_site/apps/home/forms/account_deletion.py | 1 + pydis_site/settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/forms/account_deletion.py b/pydis_site/apps/home/forms/account_deletion.py index b2160657..eec70bea 100644 --- a/pydis_site/apps/home/forms/account_deletion.py +++ b/pydis_site/apps/home/forms/account_deletion.py @@ -3,6 +3,7 @@ from django.forms import CharField, Form class AccountDeletionForm(Form): """Account deletion form, to collect username for confirmation of removal.""" + username = CharField( label="Username", required=True diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 206bec7d..2c87007c 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -52,7 +52,7 @@ if DEBUG: 'api.pythondiscord.local', 'admin.pythondiscord.local', 'staff.pythondiscord.local', - '0.0.0.0', + '0.0.0.0', # noqa: S104 'localhost', 'web', 'api.web', -- cgit v1.2.3