Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/better auth #16

Merged
merged 5 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scheduleManagement/templates/account/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<p><strong>Username:</strong> {{ user.username }}</p>
<p><strong>Email:</strong> {{ user.email }}</p>

<a href="edit/{{ user.id }}">Editar</a>
<a href="edit/{{ user.id }}">Editar Perfil</a>
<a href="delete/{{ user.id }}">Deletar Perfil</a>
<a href="/">Acessar o site</a>
</body>
</html>
2 changes: 1 addition & 1 deletion scheduleManagement/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<nav>
<ul>
<li><a href="">Schools Schedules</a></li>
<li><a href="">{{ user.username }}</a></li>
<li><a href="/accounts/profile">{{ user.username }}</a></li>
<li><a href="/accounts/logout">Logout</a></li>
</ul>
</nav>
Expand Down
7 changes: 5 additions & 2 deletions scheduleManagement/templates/object-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ <h1> {{ object_type | title }} | Details</h1>
</ul>
{% endfor %}

<button onclick="location.href = 'edit/{{ object.slug }}'" >Update</button>
<button onclick="location.href = 'delete/{{ object.slug }}'" >Delete</button>
{% if perms.scheduleManagement.can_add_curso %}
<button onclick="location.href = 'edit/{{ object.slug }}'" >Update</button>
<button onclick="location.href = 'delete/{{ object.slug }}'" >Delete</button>
{% endif %}

<a href="/list-{{ object_type }}s">Back</a>
{% endblock %}
1 change: 0 additions & 1 deletion scheduleManagement/views/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class HomeRequestHandler(LoginRequiredMixin, TemplateView):
template_name = "home.html"
redirect_field_name = "redirect_to"


class UserRequestHandler(LoginRequiredMixin, TemplateView):
Expand Down
4 changes: 4 additions & 0 deletions schoolschedules/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@

ACCOUNT_EMAIL_REQUIRED = True

ACCOUNT_CHANGE_EMAIL = True

ACCOUNT_AUTHENTICATION_METHOD = 'username_email'

AUTHENTICATION_BACKENDS = (
Expand All @@ -158,3 +160,5 @@
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
)

ACCOUNT_EMAIL_VERIFICATION = 'none'