From: Guillaume Pellerin Date: Wed, 19 Jan 2022 09:17:13 +0000 (+0100) Subject: admin contact only from "hotline" group X-Git-Tag: 2.5.1~12^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c0295b7dde82488fede189a14f98c0af9408551d;p=teleforma.git admin contact only from "hotline" group --- diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 1a8e00b9..057153e1 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -229,7 +229,10 @@ def get_all_correctors_with_courses(): @register.simple_tag def get_all_admins(): - return User.objects.filter(is_superuser=True).order_by('last_name') + users = User.objects.filter(is_superuser=True).order_by('last_name') + # only from the "hotline" group + admins = [user for user in users if user.groups.filter(name='hotline').exists()] + return @register.simple_tag