fix: update ImmediateHttpResponse import path for allauth
This commit is contained in:
51
mnemosyne/mnemosyne/templates/socialaccount/signup.html
Normal file
51
mnemosyne/mnemosyne/templates/socialaccount/signup.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{% extends "themis/base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Complete Sign Up — {{ themis_app_name }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="flex justify-center items-center min-h-[60vh]">
|
||||||
|
<div class="card bg-base-200 shadow-xl w-full max-w-md">
|
||||||
|
<div class="card-body">
|
||||||
|
<h2 class="card-title text-2xl justify-center mb-2">Complete Sign Up</h2>
|
||||||
|
<p class="text-center text-base-content/70 mb-4">
|
||||||
|
Confirm your email address to finish signing in with SSO.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% if form.errors %}
|
||||||
|
<div class="alert alert-error mb-4">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none"
|
||||||
|
viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
|
d="M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||||
|
</svg>
|
||||||
|
<span>Please correct the errors below.</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<form method="post" action="{{ action_url }}">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<div class="form-control mb-6">
|
||||||
|
<label class="label" for="id_email">
|
||||||
|
<span class="label-text">Email</span>
|
||||||
|
</label>
|
||||||
|
<input type="email" name="email" id="id_email"
|
||||||
|
class="input input-bordered w-full{% if form.email.errors %} input-error{% endif %}"
|
||||||
|
value="{{ form.email.value|default:'' }}"
|
||||||
|
autocomplete="email" required>
|
||||||
|
{% if form.email.errors %}
|
||||||
|
<label class="label">
|
||||||
|
<span class="label-text-alt text-error">{{ form.email.errors|join:", " }}</span>
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-control mt-2">
|
||||||
|
<button type="submit" class="btn btn-primary w-full">Complete Sign Up</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from allauth.account.adapter import DefaultAccountAdapter
|
from allauth.account.adapter import DefaultAccountAdapter
|
||||||
from allauth.exceptions import ImmediateHttpResponse
|
from allauth.core.exceptions import ImmediateHttpResponse
|
||||||
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class CasdoorAdapterTest(TestCase):
|
|||||||
self.assertEqual(user.groups.count(), 0)
|
self.assertEqual(user.groups.count(), 0)
|
||||||
|
|
||||||
def test_superuser_sso_login_blocked(self):
|
def test_superuser_sso_login_blocked(self):
|
||||||
from allauth.exceptions import ImmediateHttpResponse
|
from allauth.core.exceptions import ImmediateHttpResponse
|
||||||
|
|
||||||
user = User.objects.create_superuser(
|
user = User.objects.create_superuser(
|
||||||
"admin@example.com", "admin@example.com", "pass"
|
"admin@example.com", "admin@example.com", "pass"
|
||||||
|
|||||||
Reference in New Issue
Block a user