Compare commits

...

5 Commits

Author SHA1 Message Date
Joel Falknau
d10562e9fc
remove more bs3 fallback remnants 2024-12-28 14:15:09 +10:00
Joel Falknau
168b023a72
u_id param not needed 2024-12-28 13:41:39 +10:00
Joel Falknau
9df76443b1
correct discourse user updater 2024-12-28 13:35:24 +10:00
Joel Falknau
5c07f75eb5
Merge branch 'v5.x' of gitlab.com:allianceauth/allianceauth into v5.x 2024-12-28 13:14:49 +10:00
Joel Falknau
a3c6d5345b
These are warnings, id needs to be unique 2024-12-05 11:07:44 +10:00
5 changed files with 4 additions and 47 deletions

View File

@ -38,7 +38,6 @@ urlpatterns = [
name='token_refresh' name='token_refresh'
), ),
path('dashboard/', views.dashboard, name='dashboard'), path('dashboard/', views.dashboard, name='dashboard'),
path('dashboard_bs3/', views.dashboard_bs3, name='dashboard_bs3'),
path('task-counts/', views.task_counts, name='task_counts'), path('task-counts/', views.task_counts, name='task_counts'),
path('esi-check/', views.esi_check, name='esi_check'), path('esi-check/', views.esi_check, name='esi_check'),
] ]

View File

@ -392,12 +392,3 @@ def esi_check(request) -> JsonResponse:
"data": check_for_override_esi_error_message(_r) "data": check_for_override_esi_error_message(_r)
} }
return JsonResponse(data) return JsonResponse(data)
@login_required
def dashboard_bs3(request):
"""Render dashboard view with BS3 theme.
This is an internal view used for testing BS3 backward compatibility in AA4 only.
"""
return render(request, 'authentication/dashboard_bs3.html')

View File

@ -44,9 +44,9 @@ def system_package_redis(app_configs, **kwargs) -> list[CheckMessage]:
errors.append(Warning("Unable to confirm Redis Version")) errors.append(Warning("Unable to confirm Redis Version"))
return errors return errors
if redis_version.major == 7 and redis_version.minor == 4 and timezone.now() > timezone.datetime(year=2025, month=8, day=31, tzinfo=datetime.timezone.utc): if redis_version.major == 7 and redis_version.minor == 4 and timezone.now() > timezone.datetime(year=2025, month=8, day=31, tzinfo=datetime.timezone.utc):
errors.append(Error(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A001")) errors.append(Warning(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A001"))
elif redis_version.major == 7 and redis_version.minor == 2: elif redis_version.major == 7 and redis_version.minor == 2:
errors.append(Error(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A019")) errors.append(Warning(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A021"))
elif redis_version.major == 7 and redis_version.minor == 0: elif redis_version.major == 7 and redis_version.minor == 0:
errors.append(Error(f"Redis {redis_version.public} EOL", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A019")) errors.append(Error(f"Redis {redis_version.public} EOL", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A019"))
elif redis_version.major == 6 and redis_version.minor == 2: elif redis_version.major == 6 and redis_version.minor == 2:

View File

@ -68,35 +68,3 @@ class TestDefaultDashboardWithSideMenu(TestCase):
self.assertEqual(links["/dashboard/"], "Dashboard") self.assertEqual(links["/dashboard/"], "Dashboard")
self.assertEqual(links["/groups/"], "Groups") self.assertEqual(links["/groups/"], "Groups")
self.assertNotIn("http://www.example.com/alpha", links) self.assertNotIn("http://www.example.com/alpha", links)
class TestBS3DashboardWithSideMenu(TestCase):
def test_should_not_show_group_management_when_user_has_no_permission(self):
# given
user = create_user()
self.client.force_login(user)
# when
response = self.client.get("/dashboard_bs3/")
# then
self.assertEqual(response.status_code, HTTPStatus.OK)
links = extract_links(response)
self.assertEqual(links["/dashboard/"], "Dashboard")
self.assertEqual(links["/groups/"], "Groups")
self.assertNotIn("/groupmanagement/requests/", links)
def test_should_show_group_management_when_user_has_permission(self):
# given
user = create_user(permissions=["auth.group_management"])
self.client.force_login(user)
# when
response = self.client.get("/dashboard_bs3/")
# then
self.assertEqual(response.status_code, HTTPStatus.OK)
links = extract_links(response)
self.assertEqual(links["/dashboard/"], "Dashboard")
self.assertEqual(links["/groups/"], "Groups")
self.assertEqual(links["/groupmanagement/requests/"], "Group Management")

View File

@ -108,9 +108,8 @@ class DiscourseManager:
providers.discourse.client.activate(u_id) providers.discourse.client.activate(u_id)
@staticmethod @staticmethod
def __update_user(username, **kwargs): def __update_user(username, **kwargs) -> None:
u_id = DiscourseManager.__user_name_to_id(username) providers.discourse.client.update_user(username, **kwargs)
providers.discourse.client.update_user(endpoint, u_id, **kwargs)
@staticmethod @staticmethod
def __create_user(username, email, password): def __create_user(username, email, password):