Skip to content
Snippets Groups Projects
Commit 2dc244ab authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Add new certificate for gstlal

parent 02e0cba6
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-03 20:10
from __future__ import unicode_literals
from django.db import migrations
ACCOUNT = {
'name': 'gstlalcbc',
'new_cert': '/DC=org/DC=ligo/O=LIGO/OU=Services/CN=gstlalcbc/submit.nemo.uwm.edu',
}
def add_cert(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
# Get user
user = RobotUser.objects.get(username=ACCOUNT['name'])
# Create new certificate
user.x509cert_set.create(subject=ACCOUNT['new_cert'])
def delete_cert(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
# Get user
user = RobotUser.objects.get(username=ACCOUNT['name'])
# Delete new certificate
cert = user.x509cert_set.get(subject=ACCOUNT['new_cert'])
cert.delete()
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0033_add_spiir_cert'),
]
operations = [
migrations.RunPython(add_cert, delete_cert),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment