Commit a374e102 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Bugfix to a few migrations for creating robot accounts

Previously forgot to add deepclean and gwhen robot users to the
LVC group.
parent bca81cc8
......@@ -2,6 +2,7 @@
# Generated by Django 1.11.16 on 2019-01-04 18:39
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
ACCOUNT = {
......@@ -20,10 +21,15 @@ CERTS = [
def create_account_and_certs(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
Group = apps.get_model('auth', 'Group')
# Create user
user = RobotUser.objects.create(**ACCOUNT)
# Add user to LVC group
group = Group.objects.get(name=settings.LVC_GROUP)
group.user_set.add(user)
# Create X509 certificates
for subject in CERTS:
user.x509cert_set.create(subject=subject)
......
......@@ -2,6 +2,7 @@
# Generated by Django 1.11.18 on 2019-02-18 19:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
ACCOUNT = {
......@@ -19,10 +20,15 @@ CERTS = [
def create_account_and_certs(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
Group = apps.get_model('auth', 'Group')
# Create user
user = RobotUser.objects.create(**ACCOUNT)
# Add user to LVC group
group = Group.objects.get(name=settings.LVC_GROUP)
group.user_set.add(user)
# Create X509 certificates
for subject in CERTS:
user.x509cert_set.create(subject=subject)
......
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