From f7205f5ffe55c86ea6ac2683e2c2032e1d4cca8b Mon Sep 17 00:00:00 2001 From: Adams Pierre David <57180807+adamspd@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:40:39 +0200 Subject: [PATCH 1/4] Change staff member creation to get_or_create --- appointment/views_admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appointment/views_admin.py b/appointment/views_admin.py index c3dd9f1..07bf570 100644 --- a/appointment/views_admin.py +++ b/appointment/views_admin.py @@ -434,7 +434,7 @@ def create_new_staff_member(request): @require_superuser def make_superuser_staff_member(request): user = request.user - StaffMember.objects.create(user=user) + StaffMember.objects.get_or_create(user=user) return redirect('appointment:user_profile') From 96fad025a1f296f01b494d8101d37e6e8019524a Mon Sep 17 00:00:00 2001 From: Adams Pierre David <57180807+adamspd@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:59:14 +0200 Subject: [PATCH 2/4] 3.9.3b0 --- appointment/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appointment/__init__.py b/appointment/__init__.py index f58c40c..09d84cf 100644 --- a/appointment/__init__.py +++ b/appointment/__init__.py @@ -6,5 +6,5 @@ __url__ = "https://github.com/adamspd/django-appointment" __package_website__ = "https://django-appt.adamspierredavid.com/" __package_doc_url__ = "https://django-appt-doc.adamspierredavid.com/" -__version__ = "3.9.2b0" +__version__ = "3.9.3b0" __test_version__ = True From b4f093ebf22ba19271612ef19acc8cc6e8ada29a Mon Sep 17 00:00:00 2001 From: Adams Pierre David <57180807+adamspd@users.noreply.github.com> Date: Wed, 3 Sep 2025 23:23:39 +0200 Subject: [PATCH 3/4] debugging permission... --- appointment/__init__.py | 2 +- appointment/views_admin.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/appointment/__init__.py b/appointment/__init__.py index 09d84cf..599e8a5 100644 --- a/appointment/__init__.py +++ b/appointment/__init__.py @@ -6,5 +6,5 @@ __url__ = "https://github.com/adamspd/django-appointment" __package_website__ = "https://django-appt.adamspierredavid.com/" __package_doc_url__ = "https://django-appt-doc.adamspierredavid.com/" -__version__ = "3.9.3b0" +__version__ = "3.9.3b1" __test_version__ = True diff --git a/appointment/views_admin.py b/appointment/views_admin.py index 07bf570..9dd321e 100644 --- a/appointment/views_admin.py +++ b/appointment/views_admin.py @@ -149,6 +149,7 @@ def add_working_hours(request, staff_user_id=None, response_type='html'): staff_user_id = staff_user_id or request.user.pk if not check_permissions(staff_user_id, request.user): message = _("You can only add your own working hours.") + print(f"Is staff {request.user.is_staff} ? or superuser: {request.user.is_superuser} ?") return handle_unauthorized_response(request, message, response_type) staff_user_id = staff_user_id if staff_user_id else request.user.pk staff_member = get_staff_member_by_user_id(user_id=staff_user_id) From 349244f820f1026022a17d962082202d7f54cb42 Mon Sep 17 00:00:00 2001 From: Adams Pierre David <57180807+adamspd@users.noreply.github.com> Date: Thu, 4 Sep 2025 00:15:14 +0200 Subject: [PATCH 4/4] removed duplicated bootstrap css in user-profile html (which should be in base.html) --- appointment/__init__.py | 2 +- appointment/templates/administration/user_profile.html | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/appointment/__init__.py b/appointment/__init__.py index 599e8a5..5c46b5a 100644 --- a/appointment/__init__.py +++ b/appointment/__init__.py @@ -6,5 +6,5 @@ __url__ = "https://github.com/adamspd/django-appointment" __package_website__ = "https://django-appt.adamspierredavid.com/" __package_doc_url__ = "https://django-appt-doc.adamspierredavid.com/" -__version__ = "3.9.3b1" +__version__ = "3.9.3b2" __test_version__ = True diff --git a/appointment/templates/administration/user_profile.html b/appointment/templates/administration/user_profile.html index c762c67..c2b5163 100644 --- a/appointment/templates/administration/user_profile.html +++ b/appointment/templates/administration/user_profile.html @@ -7,9 +7,6 @@ - {% endblock %} {% block title %} {{ page_title }} @@ -278,4 +275,3 @@

{% trans 'Service Offered' %}

{% endblock %} -