Skip to content

Commit

Permalink
Removed email confirmation, fixed alert styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
fsargent committed Jul 25, 2024
1 parent f4ef6b0 commit 88fef5e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 28 deletions.
8 changes: 2 additions & 6 deletions approval_polls/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
environ.Env.read_env(os.path.join(os.path.dirname(BASE_DIR), ".env"))
DEBUG = env("DEBUG")
print(DEBUG)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
Expand All @@ -33,9 +34,6 @@

if DEBUG:
db_path = os.path.join(BASE_DIR, "db.sqlite3")
CSRF_TRUSTED_ORIGINS = ["http://localhost:8000", "http://127.0.0.1:8000"]
CSRF_ALLOWED_ORIGINS = ["http://localhost:8000", "http://127.0.0.1:8000"]
CORS_ORIGINS_WHITELIST = ["http://localhost:8000", "http://127.0.0.1:8000"]
ALLOWED_HOSTS.extend(["localhost", "0.0.0.0", "127.0.0.1"]) # trunk-ignore(bandit)

if not DEBUG:
Expand Down Expand Up @@ -276,7 +274,7 @@
ACCOUNT_USERNAME_REQUIRED = True
SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = True
SOCIALACCOUNT_EMAIL_AUTHENTICATION = True
ACCOUNT_EMAIL_VERIFICATION = "optional"
ACCOUNT_EMAIL_VERIFICATION = "none"
ACCOUNT_CONFIRM_EMAIL_ON_GET = True
ACCOUNT_AUTHENTICATION_METHOD = "username_email"
ACCOUNT_EMAIL_REQUIRED = True
Expand All @@ -285,6 +283,4 @@
ACCOUNT_DEFAULT_HTTP_PROTOCOL = env(
"ACCOUNT_DEFAULT_HTTP_PROTOCOL", str, default="https"
)
# ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 5 # or any reasonable number
ACCOUNT_RATE_LIMITS = False
ACCOUNT_FORMS = {"signup": "approval_polls.forms.CustomSignupForm"}
3 changes: 1 addition & 2 deletions approval_polls/staticfiles/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$primary: #000000;
$secondary: #ffffff;
$success: #000000;
$info: #ffffff;
$info: #f8f9fa; // Light gray for info messages.
$warning: #aa4a44;
$danger: #aa4a44;
$light: #ffffff;
Expand Down Expand Up @@ -133,7 +133,6 @@ body {
@each $color, $value in $theme-colors {
.alert-#{$color} {
color: $primary;
background-color: $value;
border-color: $primary;
}
}
Empty file.
6 changes: 5 additions & 1 deletion approval_polls/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
integrity="sha512-pZ0i46J1zsMwPd2NQZ4IaL427jXE2RVHMk3uv/wPTNlBVp9AbB1L65/4YdrXRPLEmyZCkY9qYOOsQp44V4orHg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
{% load compress %}
{% compress css %}
<link type="text/x-scss"
Expand Down Expand Up @@ -92,6 +91,11 @@
</nav>
</header>
<main class="container my-5">
{% if messages %}
<div class="messages">
{% for message in messages %}<div class="alert alert-{{ message.tags }}">{{ message }}</div>{% endfor %}
</div>
{% endif %}
{% block content %}
{% endblock content %}
</main>
Expand Down
19 changes: 2 additions & 17 deletions approval_polls/templates/my_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ <h1 class="mb-4">My User Profile</h1>
<div class="card-body">
<h2 class="card-title h4">Personal Information</h2>
<dl class="row">
<dt class="col-sm-3">First Name:</dt>
<dd class="col-sm-9">
{{ current_user.first_name }}
</dd>
<dt class="col-sm-3">Last Name:</dt>
<dd class="col-sm-9">
{{ current_user.last_name }}
</dd>
<dt class="col-sm-3">Username:</dt>
<dd class="col-sm-9">
{{ current_user.username }}
Expand Down Expand Up @@ -50,13 +42,6 @@ <h2 class="card-title h4">Personal Information</h2>
</div>
</div>
<h2 class="mb-3">My Polls</h2>
{% if messages %}
<div class="messages">
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% if latest_poll_list %}
{% for poll in latest_poll_list %}
<div class="card mb-3" id="poll-{{ poll.id }}">
Expand Down Expand Up @@ -84,7 +69,7 @@ <h3 class="card-title h5">
<a class="page-link"
href="?page={{ latest_poll_list.previous_page_number }}"
aria-label="Previous">
<span aria-hidden="true">&laquo;</span> Previous
<span aria-hidden="true">«</span> Previous
</a>
</li>
{% endif %}
Expand All @@ -96,7 +81,7 @@ <h3 class="card-title h5">
<a class="page-link"
href="?page={{ latest_poll_list.next_page_number }}"
aria-label="Next">
Next <span aria-hidden="true">&raquo;</span>
Next <span aria-hidden="true">»</span>
</a>
</li>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions approval_polls/templates/my_polls.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h5 class="card-title">
<a class="page-link"
href="?page={{ latest_poll_list.previous_page_number }}"
aria-label="Previous">
<span aria-hidden="true">&laquo;</span> Previous
<span aria-hidden="true">«</span> Previous
</a>
</li>
{% endif %}
Expand All @@ -45,7 +45,7 @@ <h5 class="card-title">
<a class="page-link"
href="?page={{ latest_poll_list.next_page_number }}"
aria-label="Next">
Next <span aria-hidden="true">&raquo;</span>
Next <span aria-hidden="true">»</span>
</a>
</li>
{% endif %}
Expand Down

0 comments on commit 88fef5e

Please sign in to comment.