From 0c413a9cc21c4f7296e2b097b24b1d03faa5ab1c Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Sat, 7 Feb 2026 20:15:27 -0500 Subject: [PATCH] =?UTF-8?q?pre=E2=80=93db-reset=20commit;=20attempting=20t?= =?UTF-8?q?o=20update=20User=20model=20w.=20uuid=20pk=20enumeration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/dashboard/tests/test_views.py | 9 ++++++++- src/apps/dashboard/urls.py | 1 + src/apps/lyric/models.py | 2 +- src/templates/core/base.html | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/apps/dashboard/tests/test_views.py b/src/apps/dashboard/tests/test_views.py index 7814465..e10f20e 100644 --- a/src/apps/dashboard/tests/test_views.py +++ b/src/apps/dashboard/tests/test_views.py @@ -1,3 +1,4 @@ +import lxml.html from django.test import TestCase from django.utils import html from unittest import skip @@ -6,7 +7,7 @@ from ..forms import ( EMPTY_ITEM_ERROR, ) from ..models import Item, List -import lxml.html +from apps.lyric.models import User class HomePageTest(TestCase): def test_uses_home_template(self): @@ -144,3 +145,9 @@ class ListViewTest(TestCase): self.assertContains(response, expected_error) self.assertTemplateUsed(response, "apps/dashboard/list.html") self.assertEqual(Item.objects.all().count(), 1) + +class MyListsTest(TestCase): + def test_my_lists_url_renders_my_lists_template(self): + user = User.objects.create(email="a@b.cde") + response = self.client.get(f"/apps/dashboard/users/{user.id}/") + self.assertTemplateUsed(response, "my-lists.html") diff --git a/src/apps/dashboard/urls.py b/src/apps/dashboard/urls.py index e04270e..5718e11 100644 --- a/src/apps/dashboard/urls.py +++ b/src/apps/dashboard/urls.py @@ -4,4 +4,5 @@ from . import views urlpatterns = [ path('new_list', views.new_list, name='new_list'), path('/', views.view_list, name='view_list'), + path('users//', views.my_lists, name='my_lists'), ] diff --git a/src/apps/lyric/models.py b/src/apps/lyric/models.py index d766aed..9879063 100644 --- a/src/apps/lyric/models.py +++ b/src/apps/lyric/models.py @@ -6,7 +6,7 @@ class Token(models.Model): uid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) class User(models.Model): - id = models.BigAutoField(primary_key=True) + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) email = models.EmailField(unique=True) REQUIRED_FIELDS = [] diff --git a/src/templates/core/base.html b/src/templates/core/base.html index e692902..a2387fa 100644 --- a/src/templates/core/base.html +++ b/src/templates/core/base.html @@ -18,6 +18,7 @@

Welcome, Earthman

{% if user.email %} + My lists Logged in as {{ user.email }}
{% csrf_token %}