Skip to content

Commit 3f88d57

Browse files
committed
update django-guardian
1 parent 7b5e8c5 commit 3f88d57

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

ephios/extra/auth.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ def authenticate(self, request, username=None, password=None, **kwargs):
129129
) # this already contains the claims for the tested OP, check the standard to see if we can omit the call to the user endpoint
130130
user_info = oauth.request("GET", self.provider.userinfo_endpoint).json()
131131
logger.debug(
132-
"Trying to OIDC login user with info user_info\n: {}".format(
133-
pprint.pformat(user_info)
134-
)
132+
f"Trying to OIDC login user with info user_info\n: {pprint.pformat(user_info)}"
135133
)
136134
if "email" not in user_info:
137135
raise SuspiciousOperation("OIDC client did not return email address")

ephios/extra/permissions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ def _make_permission_names_qualified(permission_names, obj: Optional):
4949
def get_groups_with_perms(
5050
obj=None, *, only_with_perms_in=None, must_have_all_perms=False, accept_global_perms=True
5151
):
52+
"""
53+
Version of `get_groups_with_perms` that has `only_with_perms` and `must_have_all_perms`.
54+
As of 2025-09-18, guardian is missing the `must_have_all_perms` option on this shortcut,
55+
but does support the `attach_perms` parameter.
56+
"""
5257
qs = Group.objects.all()
5358
qualified_permission_names = _make_permission_names_qualified(only_with_perms_in or [], obj)
5459
required_perms = get_permissions_from_qualified_names(qualified_permission_names)

poetry.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ documentation = "https://docs.ephios.de/en/stable/"
1818
python = "^3.10"
1919
Django = {version = "~5.2", extras = ["argon2"]}
2020
django-environ = ">=0.11.2,<0.13"
21-
django-guardian = "^3.0.0"
21+
django-guardian = "^3.2.0"
2222
django-ical = "^1.8.3"
2323
django-polymorphic = ">=4.1,<5.0"
2424
django-select2 = ">=8.0,<9.0"

0 commit comments

Comments
 (0)