Commit aae9bbc6 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Bugfix migration for populating raven_users group

parent 543ed965
......@@ -17,11 +17,12 @@ def add_users(apps, schema_editor):
# Get group
pg = Group.objects.get(name=GROUP_NAME)
# Get users
users = User.objects.filter(username__in=USERS)
# Users might not exist yet since they are populated from the LDAP
for username in USERS:
user, _ = User.objects.get_or_create(username=username)
# Add users
pg.user_set.add(*users)
# Add user to group
pg.user_set.add(user)
def remove_users(apps, schema_editor):
......
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