From c1984ed677b2d0c4ad2e66bcab624c65a77f3722 Mon Sep 17 00:00:00 2001
From: Laetitia Getti
Date: Thu, 27 Apr 2023 15:29:02 +0200
Subject: [PATCH] rename readme and change accounts urls
---
readMe.md => README.md | 0
la_chariotte/accounts/templates/registration/login.html | 1 +
la_chariotte/accounts/urls.py | 3 ++-
la_chariotte/accounts/views.py | 2 +-
la_chariotte/order/templates/order/grouped_order_detail.html | 2 +-
la_chariotte/order/tests/test_views.py | 4 ++--
la_chariotte/settings.py | 2 +-
la_chariotte/templates/home.html | 4 ++--
la_chariotte/urls.py | 1 -
9 files changed, 10 insertions(+), 9 deletions(-)
rename readMe.md => README.md (100%)
diff --git a/readMe.md b/README.md
similarity index 100%
rename from readMe.md
rename to README.md
diff --git a/la_chariotte/accounts/templates/registration/login.html b/la_chariotte/accounts/templates/registration/login.html
index b4f1f96..dacc4b9 100644
--- a/la_chariotte/accounts/templates/registration/login.html
+++ b/la_chariotte/accounts/templates/registration/login.html
@@ -8,6 +8,7 @@
{% csrf_token %}
{{ form.as_p }}
+ Créer un compte
{% endblock %}
\ No newline at end of file
diff --git a/la_chariotte/accounts/urls.py b/la_chariotte/accounts/urls.py
index 7d7d715..ebf4479 100644
--- a/la_chariotte/accounts/urls.py
+++ b/la_chariotte/accounts/urls.py
@@ -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")),
]
diff --git a/la_chariotte/accounts/views.py b/la_chariotte/accounts/views.py
index d9eb103..bf85312 100644
--- a/la_chariotte/accounts/views.py
+++ b/la_chariotte/accounts/views.py
@@ -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"
diff --git a/la_chariotte/order/templates/order/grouped_order_detail.html b/la_chariotte/order/templates/order/grouped_order_detail.html
index d928efb..8ad777f 100644
--- a/la_chariotte/order/templates/order/grouped_order_detail.html
+++ b/la_chariotte/order/templates/order/grouped_order_detail.html
@@ -20,7 +20,7 @@
{% if user == grouped_order.orga %}
- Page de gestion de la comande groupée
+ Page de gestion de la commande groupée
{% endif %}
les produits disponibles pour cette commande groupée :
diff --git a/la_chariotte/order/tests/test_views.py b/la_chariotte/order/tests/test_views.py
index 6b1bf64..715d857 100644
--- a/la_chariotte/order/tests/test_views.py
+++ b/la_chariotte/order/tests/test_views.py
@@ -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",
diff --git a/la_chariotte/settings.py b/la_chariotte/settings.py
index 3d6b1b7..7bb7f4d 100644
--- a/la_chariotte/settings.py
+++ b/la_chariotte/settings.py
@@ -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"
diff --git a/la_chariotte/templates/home.html b/la_chariotte/templates/home.html
index 1a10e34..8ae7be6 100644
--- a/la_chariotte/templates/home.html
+++ b/la_chariotte/templates/home.html
@@ -9,11 +9,11 @@
Mes commandes groupées
- Se déconnecter
+ Se déconnecter
{% else %}
You are not logged in
- Se connecter
+ Se connecter
{% endif %}
{% endblock %}
diff --git a/la_chariotte/urls.py b/la_chariotte/urls.py
index 12ca068..0a86d20 100644
--- a/la_chariotte/urls.py
+++ b/la_chariotte/urls.py
@@ -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"),
]