From e6f855b8d94b214ceb36ebe6f21adc70bf4280b9 Mon Sep 17 00:00:00 2001
From: Ivan Procaccini <ivan.procaccini14@imperial.ac.uk>
Date: Tue, 8 Nov 2022 19:58:46 +0000
Subject: [PATCH] Improve code style (suggestion by Ivan)

---
 app/ldap_authentication/authenticator.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/ldap_authentication/authenticator.py b/app/ldap_authentication/authenticator.py
index 04a1b8f..d9a316a 100644
--- a/app/ldap_authentication/authenticator.py
+++ b/app/ldap_authentication/authenticator.py
@@ -79,8 +79,7 @@ class DocLdapAuthenticator(Authenticator):
         logging_in_as = username
         users = re.match(IMPERSONATION_PATTERN, username)
         if users:
-            impersonator = users.groups()[0]
-            impersonated = users.groups()[1]
+            impersonator, impersonated = users.groups()
             if impersonator in IMPERSONATORS:
                 username = impersonator
                 logging_in_as = impersonated
-- 
GitLab