Maintenance will be performed on,,, and tomorrow, 2020/08/04, starting at approximately 9am PDT. It is expected to take around 15 minutes and there will be a short period of downtime towards the end of the maintenance window. Please direct any comments, questions or concerns to

Commit 546c3d5b authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Update certificates for LHO CDS

parent 8cee4a4c
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-14 15:55
from __future__ import unicode_literals
from django.db import migrations
ACCOUNT_NAME = 'cds_lho'
NEW_CERT = '/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/ Barker/CN=UID:david.barker.robot'
def update_certs(apps, schema_editor):
User = apps.get_model('auth', 'User')
# Get user
user = User.objects.get(username=ACCOUNT_NAME)
# Create new certificate
# Delete old certificates
for subj in OLD_CERTS:
old_cert = user.x509cert_set.get(subject=subj)
def revert_certs(apps, schema_editor):
User = apps.get_model('auth', 'User')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
# Delete new certificate
new_cert = X509Cert.objects.get(subject=NEW_CERT)
# Get user
user = User.objects.get(username=ACCOUNT_NAME)
# Create old certificates
for subj in OLD_CERTS:
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0016_update_bayeswave_certs'),
operations = [
migrations.RunPython(update_certs, revert_certs),
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