diff --git a/apps/users/tests.py b/apps/users/tests.py index 4e8d3fe..d7bcf78 100644 --- a/apps/users/tests.py +++ b/apps/users/tests.py @@ -117,3 +117,18 @@ def test_post_valid_data(self) -> None: self.assertIsNotNone(user) self.client.force_login(user) self.assertTrue(self.client.session["_auth_user_id"]) + + def test_email(self) -> None: + user = User.objects.create_user( + username="testuser", + email="test@example.com", + password="testpassword", + ) + self.client.force_login(user) + + url = reverse("users:profile", args=[user.username]) + + response = self.client.get(url) + + self.assertEqual(response.status_code, 200) + self.assertContains(response, user.email) diff --git a/apps/users/urls.py b/apps/users/urls.py index a3d45bc..38f99fb 100644 --- a/apps/users/urls.py +++ b/apps/users/urls.py @@ -1,9 +1,12 @@ from django.urls import path -from apps.users.views import RegisterView +from apps.users.views import ProfileView, RegisterView app_name = "users" urlpatterns = [ - path("", RegisterView.as_view(), name="register"), + path("register/", RegisterView.as_view(), name="register"), + path( + "profile//", ProfileView.as_view(), name="profile" + ), ] diff --git a/apps/users/views.py b/apps/users/views.py index adabd04..abadc59 100644 --- a/apps/users/views.py +++ b/apps/users/views.py @@ -1,9 +1,10 @@ from django.contrib.auth import login from django.http import HttpRequest, HttpResponse -from django.shortcuts import redirect, render +from django.shortcuts import get_object_or_404, redirect, render from django.views import View from apps.users.forms import CreateUserForm +from apps.users.models import User class RegisterView(View): @@ -25,3 +26,11 @@ def post(self, request: HttpRequest) -> HttpResponse: return redirect("home") return render(request, self.template_name, {"form": form}) + + +class ProfileView(View): + template_name = "users/profile.html" + + def get(self, request: HttpRequest, user_username: str) -> HttpResponse: + user = get_object_or_404(User, username=user_username) + return render(request, self.template_name, {"user": user}) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index b5272ba..cf17078 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -141,7 +141,7 @@ executará as migrações. Faça isso com o seguinte comando: .. code-block:: bash - $ docker compose run --rm web python manage.py migrate + $ docker compose run --rm django python manage.py migrate .. hint:: @@ -221,10 +221,10 @@ seguinte comando: .. code-block:: bash - $ docker compose run --rm web python manage.py createsuperuser + $ docker compose run --rm django python manage.py createsuperuser E para criar migrações do banco de dados, use o seguinte comando: .. code-block:: bash - $ docker compose run --rm web python manage.py makemigrations + $ docker compose run --rm django python manage.py makemigrations diff --git a/docs/source/reunioes/atas/reuniao-04.rst b/docs/source/reunioes/atas/reuniao-04.rst index d790cff..d2d06f4 100644 --- a/docs/source/reunioes/atas/reuniao-04.rst +++ b/docs/source/reunioes/atas/reuniao-04.rst @@ -1,7 +1,7 @@ Reunião 04 ========== -:bdg-info:`18/10/2023` :bdg-warning:`Sprint 2` +:bdg-info:`18/10/2023` :bdg-warning:`Sprint 2` Resumo ------ diff --git a/docs/source/reunioes/atas/reuniao-05.rst b/docs/source/reunioes/atas/reuniao-05.rst new file mode 100644 index 0000000..c4252d3 --- /dev/null +++ b/docs/source/reunioes/atas/reuniao-05.rst @@ -0,0 +1,10 @@ +Reunião 04 +========== + +:bdg-info:`25/10/2023` :bdg-warning:`Sprint 3` + +Resumo +------ + +Esta reunião teve como objetivos nivelar o nivel de conhecimento dos integrantes e retirada +de duvidas. diff --git a/docs/source/reunioes/atas/reuniao-06.rst b/docs/source/reunioes/atas/reuniao-06.rst new file mode 100644 index 0000000..134b718 --- /dev/null +++ b/docs/source/reunioes/atas/reuniao-06.rst @@ -0,0 +1,10 @@ +Reunião 06 +========== + +:bdg-info:`13/11/2023` :bdg-warning:`Sprint 4` + +Resumo +------ + +Esta reunião teve como objetivos discutir o progresso, anunciar a saida de um +integrante. diff --git a/docs/source/reunioes/atas/reuniao-07.rst b/docs/source/reunioes/atas/reuniao-07.rst new file mode 100644 index 0000000..b1c5615 --- /dev/null +++ b/docs/source/reunioes/atas/reuniao-07.rst @@ -0,0 +1,10 @@ +Reunião 07 +========== + +:bdg-info:`16/11/2023` :bdg-warning:`Sprint 4` + +Resumo +------ + +Esta reunião teve como objetivos redistribuir as partes de cada integrante e a +redução do prazo para entrega das issues. diff --git a/docs/source/reunioes/intro.rst b/docs/source/reunioes/intro.rst index 8015d37..55d95cf 100644 --- a/docs/source/reunioes/intro.rst +++ b/docs/source/reunioes/intro.rst @@ -25,3 +25,6 @@ Atas atas/reuniao-02 atas/reuniao-03 atas/reuniao-04 + atas/reuniao-05 + atas/reuniao-06 + atas/reuniao-07 diff --git a/docs/source/scrum/intro.rst b/docs/source/scrum/intro.rst index d1065cc..3011151 100644 --- a/docs/source/scrum/intro.rst +++ b/docs/source/scrum/intro.rst @@ -23,3 +23,4 @@ Sprints sprints/sprint-1 sprints/sprint-2 sprints/sprint-3 + sprints/sprint-4 diff --git a/docs/source/scrum/sprints/sprint-4.rst b/docs/source/scrum/sprints/sprint-4.rst new file mode 100644 index 0000000..37c6daf --- /dev/null +++ b/docs/source/scrum/sprints/sprint-4.rst @@ -0,0 +1,32 @@ +Sprint 4 +======== + +:bdg-info:`19/11/2023` + +Resumo +------ + +Nesta sprint, a equipe de desenvolvimento começou a trabalhar na segunda release. As +principais atividades foram o início do desenvolvimento da parte de submissões e a +estilização da página de login para melhor acessibilidade do usuário. + + +Changelog +---------- + +- `Criar app de submissões (#66) `_ +- `App inicial de submissões (PR) (#77) `_ +- `Adicionar validadores em todas as páginas de admin (PR) (#76) `_ +- `Estilizar página de login (#63) `_ +- `Estilizar página de login (PR) (#75) `_ +- `Adicionar documentação da Sprint 03 (#62) `_ +- `Adicionar Documentação da Sprint 03 (PR) (#73) `_ +- `Retirar nome de ex-integrante do grupo (#72) `_ +- `Remover Nome de ex-Integrante (PR) (#74) `_ +- `Adicionar Documentação da Sprint 02 (#67) `_ +- `Adicionar documentação da Sprint 02 (PR) (#70) `_ +- `Renomear o app apps.problems para apps.tasks (#31) `_ +- `Rename apps.problems to apps.tasks (PR) (#61) `_ +- `Initial problems form development (PR) (#65) `_ +- `Add integrations with CI services (PR) (#59) `_ +- `Bump django from 4.2.5 to 4.2.7 (PR) (#58) `_ diff --git a/server/settings/development.py b/server/settings/development.py index 8e568b0..91061cf 100644 --- a/server/settings/development.py +++ b/server/settings/development.py @@ -5,6 +5,7 @@ "0.0.0.0", "127.0.0.1", ".herokuapp.com", + "develop.squad06.com", ] # In development, we don't need a secure password hasher. We can use diff --git a/server/urls.py b/server/urls.py index 1880622..c9f993e 100644 --- a/server/urls.py +++ b/server/urls.py @@ -11,5 +11,5 @@ path("", IndexView.as_view(), name="home"), path("contests/", include("apps.contests.urls"), name="contests"), path("tasks/", include("apps.tasks.urls")), - path("register/", include("apps.users.urls")), + path("", include("apps.users.urls")), ] diff --git a/templates/base.html b/templates/base.html index d00329c..506bc82 100644 --- a/templates/base.html +++ b/templates/base.html @@ -90,7 +90,7 @@ {% endif %} -
  • Your profile
  • +
  • Your profile
  • diff --git a/templates/users/profile.html b/templates/users/profile.html new file mode 100644 index 0000000..8d407d2 --- /dev/null +++ b/templates/users/profile.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}User{% endblock title %} + +{% block content %} + +{% endblock content %}