diff --git a/config/settings/base.py b/config/settings/base.py index ce6b732768fff6364b3ffc7a84af8b79d9d61a55..6a32f0456bfd6f9768e47e51380fd1abcc323f32 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -326,7 +326,6 @@ INSTALLED_APPS = [ 'ligoauth', 'search', 'superevents', - 'userprofile', 'rest_framework', 'guardian', 'django_twilio', @@ -580,11 +579,6 @@ LOGGING = { 'propagate': True, 'level': LOG_LEVEL, }, - 'userprofile': { - 'handlers': ['debug_file','error_file'], - 'propagate': True, - 'level': LOG_LEVEL, - }, 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', diff --git a/config/urls.py b/config/urls.py index 79029217cdb0dc049b7d62050295e9eded0989c9..0129d11919e3fadae88088c9456c5d506dd9d41f 100644 --- a/config/urls.py +++ b/config/urls.py @@ -33,7 +33,7 @@ urlpatterns = [ template_name='discovery.html'), name="discovery"), url(r'^events/', include('events.urls')), url(r'^superevents/', include('superevents.urls')), - url(r'^options/', include('userprofile.urls')), + url(r'^options/', include('alerts.urls')), url(r'^feeds/(?P<url>.*)/$', EventFeed()), url(r'^feeds/$', feedview, name="feeds"), diff --git a/gracedb/userprofile/admin.py b/gracedb/alerts/admin.py similarity index 100% rename from gracedb/userprofile/admin.py rename to gracedb/alerts/admin.py diff --git a/gracedb/userprofile/forms.py b/gracedb/alerts/forms.py similarity index 100% rename from gracedb/userprofile/forms.py rename to gracedb/alerts/forms.py diff --git a/gracedb/alerts/main.py b/gracedb/alerts/main.py index 475c8dd6c0c82eb2a70bee4bef3f416645986d48..03dd2f7e9a170c4376e8fdc1155de9da669ce910 100644 --- a/gracedb/alerts/main.py +++ b/gracedb/alerts/main.py @@ -18,7 +18,7 @@ from events.permission_utils import is_external from events.shortcuts import is_event from search.query.labels import filter_for_labels from superevents.shortcuts import is_superevent -from userprofile.models import Contact +from .models import Contact from .email import issue_email_alerts from .phone import issue_phone_alerts from .xmpp import issue_xmpp_alerts diff --git a/gracedb/userprofile/__init__.py b/gracedb/alerts/management/__init__.py similarity index 100% rename from gracedb/userprofile/__init__.py rename to gracedb/alerts/management/__init__.py diff --git a/gracedb/userprofile/management/__init__.py b/gracedb/alerts/management/commands/__init__.py similarity index 100% rename from gracedb/userprofile/management/__init__.py rename to gracedb/alerts/management/commands/__init__.py diff --git a/gracedb/userprofile/management/commands/remove_inactive_alerts.py b/gracedb/alerts/management/commands/remove_inactive_alerts.py similarity index 96% rename from gracedb/userprofile/management/commands/remove_inactive_alerts.py rename to gracedb/alerts/management/commands/remove_inactive_alerts.py index 9d48c50ab4615ecf629f1de1d776731f6e34b5a3..8117eaf7f28e38ede9f3a826b107c280829c1b9f 100644 --- a/gracedb/userprofile/management/commands/remove_inactive_alerts.py +++ b/gracedb/alerts/management/commands/remove_inactive_alerts.py @@ -4,7 +4,7 @@ from django.conf import settings from django.contrib.auth.models import Group from django.core.management.base import BaseCommand, CommandError -from userprofile.models import Contact, Trigger +from alerts.models import Contact, Trigger class Command(BaseCommand): diff --git a/gracedb/alerts/migrations/0001_initial.py b/gracedb/alerts/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..0097f75d6412b0bb481455af2cbc5e5eec87d436 --- /dev/null +++ b/gracedb/alerts/migrations/0001_initial.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-01-17 20:11 +from __future__ import unicode_literals + +import alerts.models +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('events', '0031_hwinj_labels'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('desc', models.CharField(max_length=20)), + ('email', models.EmailField(blank=True, max_length=254)), + ('phone', alerts.models.PhoneNumberField(blank=True, max_length=255, validators=[alerts.models.validate_phone])), + ('call_phone', models.BooleanField(default=False)), + ('text_phone', models.BooleanField(default=False)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Trigger', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('triggerType', models.CharField(blank=True, choices=[(b'create', b'create'), (b'change', b'change'), (b'label', b'label')], max_length=20)), + ('farThresh', models.FloatField(blank=True, null=True)), + ('label_query', models.CharField(blank=True, max_length=100)), + ('contacts', models.ManyToManyField(to='alerts.Contact')), + ('labels', models.ManyToManyField(blank=True, to='events.Label')), + ('pipelines', models.ManyToManyField(blank=True, to='events.Pipeline')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/gracedb/userprofile/management/commands/__init__.py b/gracedb/alerts/migrations/__init__.py similarity index 100% rename from gracedb/userprofile/management/commands/__init__.py rename to gracedb/alerts/migrations/__init__.py diff --git a/gracedb/userprofile/models.py b/gracedb/alerts/models.py similarity index 100% rename from gracedb/userprofile/models.py rename to gracedb/alerts/models.py diff --git a/gracedb/userprofile/migrations/__init__.py b/gracedb/alerts/tests/__init__.py similarity index 100% rename from gracedb/userprofile/migrations/__init__.py rename to gracedb/alerts/tests/__init__.py diff --git a/gracedb/userprofile/tests/test_access.py b/gracedb/alerts/tests/test_access.py similarity index 99% rename from gracedb/userprofile/tests/test_access.py rename to gracedb/alerts/tests/test_access.py index ac696808aab163d87d795f666d23eb145fdea55b..70ef49fe2c3c6332d7e533a7e2d398cbe25e768b 100644 --- a/gracedb/userprofile/tests/test_access.py +++ b/gracedb/alerts/tests/test_access.py @@ -5,7 +5,7 @@ from django.contrib.auth.models import Group as AuthGroup from django.urls import reverse from core.tests.utils import GraceDbTestBase -from userprofile.models import Contact, Trigger +from alerts.models import Contact, Trigger class TestIndexView(GraceDbTestBase): diff --git a/gracedb/userprofile/urls.py b/gracedb/alerts/urls.py similarity index 100% rename from gracedb/userprofile/urls.py rename to gracedb/alerts/urls.py diff --git a/gracedb/userprofile/views.py b/gracedb/alerts/views.py similarity index 100% rename from gracedb/userprofile/views.py rename to gracedb/alerts/views.py diff --git a/gracedb/userprofile/migrations/0001_initial.py b/gracedb/userprofile/migrations/0001_initial.py deleted file mode 100644 index 8890964823607e5ce381d682164926c25b325bdb..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0001_initial.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('events', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Contact', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('desc', models.CharField(max_length=20)), - ('email', models.EmailField(max_length=75)), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Trigger', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('triggerType', models.CharField(blank=True, max_length=20, choices=[(b'create', b'create'), (b'change', b'change'), (b'label', b'label')])), - ('farThresh', models.FloatField(null=True, blank=True)), - ('contacts', models.ManyToManyField(to='userprofile.Contact', blank=True)), - ('labels', models.ManyToManyField(to='events.Label', blank=True)), - ('pipelines', models.ManyToManyField(to='events.Pipeline', blank=True)), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), - ], - options={ - }, - bases=(models.Model,), - ), - ] diff --git a/gracedb/userprofile/migrations/0002_alter_email_field_length.py b/gracedb/userprofile/migrations/0002_alter_email_field_length.py deleted file mode 100644 index 05eed61569623aecc50f4fdba3c228289ae3eebd..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0002_alter_email_field_length.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('userprofile', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='contact', - name='email', - field=models.EmailField(max_length=254), - ), - ] diff --git a/gracedb/userprofile/migrations/0003_trigger_label_query.py b/gracedb/userprofile/migrations/0003_trigger_label_query.py deleted file mode 100644 index 98ac95c70f7546c68747eec58851e22aaade4f30..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0003_trigger_label_query.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('userprofile', '0002_alter_email_field_length'), - ] - - operations = [ - migrations.AddField( - model_name='trigger', - name='label_query', - field=models.CharField(max_length=100, blank=True), - ), - ] diff --git a/gracedb/userprofile/migrations/0004_add_contact_phone_number.py b/gracedb/userprofile/migrations/0004_add_contact_phone_number.py deleted file mode 100644 index d262aa1aecfc40cbd90d6788ccfaead3a14d5b2c..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0004_add_contact_phone_number.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import userprofile.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('userprofile', '0003_trigger_label_query'), - ] - - operations = [ - migrations.AddField( - model_name='contact', - name='phone', - field=userprofile.models.PhoneNumberField(blank=True, max_length=255, validators=[userprofile.models.validate_phone, userprofile.models.validate_phone, userprofile.models.validate_phone]), - ), - migrations.AlterField( - model_name='contact', - name='email', - field=models.EmailField(max_length=254, blank=True), - ), - ] diff --git a/gracedb/userprofile/migrations/0005_separate_call_and_text_alerts.py b/gracedb/userprofile/migrations/0005_separate_call_and_text_alerts.py deleted file mode 100644 index 5714f5e830f16aca7e899d6837d536015b337adf..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0005_separate_call_and_text_alerts.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import userprofile.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('userprofile', '0004_add_contact_phone_number'), - ] - - operations = [ - migrations.AddField( - model_name='contact', - name='call_phone', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='contact', - name='text_phone', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='contact', - name='phone', - field=userprofile.models.PhoneNumberField(blank=True, max_length=255, validators=[userprofile.models.validate_phone]), - ), - ] diff --git a/gracedb/userprofile/migrations/0006_alter_trigger_contacts_field.py b/gracedb/userprofile/migrations/0006_alter_trigger_contacts_field.py deleted file mode 100644 index 2cf4fbdc937a87d4a4e79b799134ec7e401ccafb..0000000000000000000000000000000000000000 --- a/gracedb/userprofile/migrations/0006_alter_trigger_contacts_field.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.5 on 2017-10-18 17:15 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('userprofile', '0005_separate_call_and_text_alerts'), - ] - - operations = [ - migrations.AlterField( - model_name='trigger', - name='contacts', - field=models.ManyToManyField(to='userprofile.Contact'), - ), - ] diff --git a/gracedb/userprofile/tests/__init__.py b/gracedb/userprofile/tests/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000