Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

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

Add account and cert for Fermi GBM follow-up

parent 0c815890
Pipeline #55030 passed with stages
in 7 minutes
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-03-27 17:12
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
'username': 'fermi-gbm-follow-up',
'email': '',
'first_name': '',
'last_name': 'Fermi-GBM follow-up',
'/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/ Littenberg/CN=UID:tyson.littenberg.robot',
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)
# Create X509 certificates
for subject in CERTS:
def delete_account_and_certs(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
# Get user
user = RobotUser.objects.get(username=ACCOUNT['username'])
# Delete certs
for cert in user.x509cert_set.filter(subject__in=CERTS):
# Delete full User object
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0027_add_olib_cert'),
operations = [
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