Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/deps/344/djang…
Browse files Browse the repository at this point in the history
…o-3.0
  • Loading branch information
MarkKoz committed Jul 15, 2020
2 parents 9208e0a + 1835332 commit dec440d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 46 deletions.
2 changes: 0 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ verify_ssl = true

[packages]
django = "~=3.0.4"
django-crispy-forms = "~=1.9.0"
django-environ = "~=0.4.5"
django-filter = "~=2.1.0"
django-hosts = "~=4.0"
djangorestframework = "~=3.11.0"
djangorestframework-bulk = "~=0.2.1"
psycopg2-binary = "~=2.8"
django-simple-bulma = "~=1.2"
django-crispy-bulma = {git = "https://github.com/python-discord/django-crispy-bulma.git", ref = "0.3"}
whitenoise = "~=5.0"
requests = "~=2.21"
pygments = "~=2.3.1"
Expand Down
14 changes: 1 addition & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions pydis_site/apps/home/forms/account_deletion.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout
from django.forms import CharField, Form
from django_crispy_bulma.layout import IconField, Submit


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"))

self.helper.layout = Layout(
IconField("username", icon_prepend="user")
)

username = CharField(
label="Username",
required=True
Expand Down
16 changes: 2 additions & 14 deletions pydis_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
'api.pythondiscord.local',
'admin.pythondiscord.local',
'staff.pythondiscord.local',
'0.0.0.0', # noqa: S104
'localhost',
'web',
'api.web',
'admin.web',
Expand Down Expand Up @@ -104,8 +106,6 @@
'allauth.socialaccount.providers.discord',
'allauth.socialaccount.providers.github',

'crispy_forms',
'django_crispy_bulma',
'django_hosts',
'django_filters',
'django_nyt.apps.DjangoNytConfig',
Expand Down Expand Up @@ -288,7 +288,6 @@
}

# Django Messages framework config

MESSAGE_TAGS = {
messages.DEBUG: 'primary',
messages.INFO: 'info',
Expand All @@ -297,17 +296,6 @@
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
Expand Down
9 changes: 6 additions & 3 deletions pydis_site/templates/home/account/delete.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% extends 'base/base.html' %}

{% load crispy_forms_tags %}
{% load static %}

{% block title %}Delete Account{% endblock %}
Expand Down Expand Up @@ -36,7 +34,12 @@ <h2 class="is-size-2 has-text-centered">Account Deletion</h2>

<div class="columns is-centered">
<div class="column is-half-desktop is-full-tablet is-full-mobile">
{% crispy form %}
<form method="post">
{% csrf_token %}
<label for="id_username" class="label requiredField">Username</label>
<input id="id_username" class="input" type="text" required name="username">
<input style="margin-top: 1em;" type="submit" value="I understand, delete my account" class="button is-primary">
</form>
</div>
</div>
</div>
Expand Down

0 comments on commit dec440d

Please sign in to comment.