Don't change ldap group membership if it's not configured

This commit is contained in:
Tanner Collin 2020-09-27 04:07:42 +00:00
parent ced94ae019
commit 8d82b7e85b

View File

@ -217,6 +217,7 @@ class TrainingViewSet(Base, Retrieve, Create, Update):
elif session.course.id == 247: elif session.course.id == 247:
member.rabbit_cert_date = utils.today_alberta_tz() if status == 'Attended' else None member.rabbit_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
if utils_ldap.is_configured():
if status == 'Attended': if status == 'Attended':
utils_ldap.add_to_group(member, 'Laser Users') utils_ldap.add_to_group(member, 'Laser Users')
else: else:
@ -224,6 +225,7 @@ class TrainingViewSet(Base, Retrieve, Create, Update):
elif session.course.id == 321: elif session.course.id == 321:
member.trotec_cert_date = utils.today_alberta_tz() if status == 'Attended' else None member.trotec_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
if utils_ldap.is_configured():
if status == 'Attended': if status == 'Attended':
utils_ldap.add_to_group(member, 'Trotec Users') utils_ldap.add_to_group(member, 'Trotec Users')
else: else: