Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 26 May 2020 starting at approximately 10am CDT. It is expected to take around 30 minutes and will involve a short period of downtime, around 5 minutes, towards the end of the maintenance period. Please address any questions, comments, or concerns to uwm-help@cgca.uwm.edu.

Commit 33065db7 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Fix intermittent IntegrityError in control room group middleware

parent c779476b
......@@ -126,8 +126,11 @@ class ControlRoomMiddleware(object):
# Add user to control room group(s)
for ifo, ip in settings.CONTROL_ROOM_IPS.iteritems():
if (ip == user_ip):
request.user.groups.add(Group.objects.get(name=
ifo.lower() + self.control_room_group_suffix))
control_room_group = Group.objects.get(name=
(ifo.lower() + self.control_room_group_suffix))
request.user.groups.through.objects.get_or_create(
user=request.user, group=control_room_group)
break
return request
......
Markdown is supported
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