mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-01 11:22:24 +02:00
rename readme and change accounts urls
This commit is contained in:
parent
3afaafbcdb
commit
c1984ed677
9 changed files with 10 additions and 9 deletions
|
@ -8,6 +8,7 @@
|
|||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit">Se connecter</button>
|
||||
<a href="{% url 'accounts:signup' %}">Créer un compte</button>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
|
@ -1,8 +1,9 @@
|
|||
from django.urls import path
|
||||
from django.urls import include, path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "accounts"
|
||||
urlpatterns = [
|
||||
path("inscription/", views.SignUpView.as_view(), name="signup"),
|
||||
path("", include("django.contrib.auth.urls")),
|
||||
]
|
||||
|
|
|
@ -5,5 +5,5 @@ from django.views import generic
|
|||
|
||||
class SignUpView(generic.CreateView):
|
||||
form_class = UserCreationForm
|
||||
success_url = reverse_lazy("login")
|
||||
success_url = reverse_lazy("accounts:login")
|
||||
template_name = "registration/signup.html"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
{% if user == grouped_order.orga %}
|
||||
<a href="{% url 'order:grouped_order_overview' grouped_order.id %}">
|
||||
Page de gestion de la comande groupée</a>
|
||||
Page de gestion de la commande groupée</a>
|
||||
{% endif %}
|
||||
|
||||
<p>les produits disponibles pour cette commande groupée : </p>
|
||||
|
|
|
@ -32,7 +32,7 @@ class TestGroupedOrderIndexView:
|
|||
assert auth.get_user(client).is_anonymous
|
||||
response = client.get(reverse("order:index"))
|
||||
assert response.status_code == 302
|
||||
assert response.url.startswith(reverse("login"))
|
||||
assert response.url.startswith(reverse("accounts:login"))
|
||||
assert response.url.endswith(reverse("order:index"))
|
||||
|
||||
def test_no_grouped_orders(self, client_log):
|
||||
|
@ -271,7 +271,7 @@ class TestGroupedOrderOrgaView:
|
|||
assert auth.get_user(client).is_anonymous
|
||||
response = client.get(orga_view_url)
|
||||
assert response.status_code == 302
|
||||
assert response.url.startswith(reverse("login"))
|
||||
assert response.url.startswith(reverse("accounts:login"))
|
||||
assert response.url.endswith(
|
||||
reverse(
|
||||
"order:grouped_order_overview",
|
||||
|
|
|
@ -53,7 +53,7 @@ MIDDLEWARE = [
|
|||
|
||||
ROOT_URLCONF = "la_chariotte.urls"
|
||||
|
||||
LOGIN_URL = "login"
|
||||
LOGIN_URL = "accounts:login"
|
||||
LOGIN_REDIRECT_URL = "home"
|
||||
LOGOUT_REDIRECT_URL = "home"
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
<a href="{% url 'order:index' %}">Mes commandes groupées</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="{% url 'logout' %}">Se déconnecter</a>
|
||||
<a href="{% url 'accounts:logout' %}">Se déconnecter</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>You are not logged in</p>
|
||||
<a href="{% url 'login' %}">Se connecter</a>
|
||||
<a href="{% url 'accounts:login' %}">Se connecter</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -21,6 +21,5 @@ urlpatterns = [
|
|||
path("admin/", admin.site.urls),
|
||||
path("commande/", include("la_chariotte.order.urls")),
|
||||
path("comptes/", include("la_chariotte.accounts.urls")),
|
||||
path("comptes/", include("django.contrib.auth.urls")),
|
||||
path("", TemplateView.as_view(template_name="home.html"), name="home"),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue