Commit dbe229db authored by Birin Sanchez's avatar Birin Sanchez
Browse files

When enabling a tunnel service set is_active=False only when the


user does not have a tunnel account.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent 2614e4d7
Pipeline #14714 passed with stage
in 40 seconds
......@@ -138,8 +138,10 @@ class Limit(models.Model):
def enable(self, ren_date):
if self.service == settings.LM_SERVICES.TUNNEL:
# TUNNEL special case requires user manual activation
self.is_active = False
# TUNNEL special case. It requires user manual activation
# the first time to trigger tunnel_account creation
if not self.user.has_tunnel_account():
self.is_active = False
elif self.service == settings.LM_SERVICES.CHAT:
self.user.set_ldap_group("chat")
self.is_active = True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment