diff --git a/gracedb/ligoauth/migrations/0052_update_gstlalcbc_O3b_cert.py b/gracedb/ligoauth/migrations/0052_update_gstlalcbc_O3b_cert.py new file mode 100644 index 0000000000000000000000000000000000000000..cc2adc205312cdb3a0774808f4ab940cd3a1df55 --- /dev/null +++ b/gracedb/ligoauth/migrations/0052_update_gstlalcbc_O3b_cert.py @@ -0,0 +1,47 @@ +# -*- 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 + +# The new cert and subject line came as a result of gstlalcbc's old +# certificate expiring on Oct 1, 2019. The new cert was generated +# on Oct 7, 2019 and expires Oct 7, 2020. So this one should get +# through O3b. + +ACCOUNT = { + 'name': 'gstlalcbc', + 'new_cert': '/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=cbc.ligo.caltech.edu/CN=gstlalcbc/CN=Chad Hanna/CN=UID:chad.hanna.robot', +} + + +def add_cert(apps, schema_editor): + RobotUser = apps.get_model('auth', 'User') + + # 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', '0051_populate_grb_managers_authgroup'), + ] + + operations = [ + migrations.RunPython(add_cert, delete_cert), + ] diff --git a/gracedb/superevents/migrations/0005_add_coinc_far_and_em_type.py b/gracedb/superevents/migrations/0005_add_coinc_far_and_em_type.py new file mode 100644 index 0000000000000000000000000000000000000000..71589d2d4fe6e1891e2359ff2324d8069797d4fb --- /dev/null +++ b/gracedb/superevents/migrations/0005_add_coinc_far_and_em_type.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-05-15 18:07 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('superevents', '0004_populate_voevent_fields'), + ] + + operations = [ + migrations.AddField( + model_name='Superevent', + name='coinc_far', + field=models.FloatField(blank=True, null=True), + ), + migrations.AddField( + model_name='Superevent', + name='em_type', + field=models.CharField(blank=True, default=b'', max_length=100), + ), + ]