From 06df877affd1034f8795470e1ed6f511d4d8dbad Mon Sep 17 00:00:00 2001
From: Roy Williams <roy@caltech.edu>
Date: Tue, 21 Oct 2014 09:51:24 -0700
Subject: [PATCH] small changes because of the name change of the dev box

---
 gracedb/management/commands/ingest_email.py | 13 +++++++++----
 settings/default.py                         |  2 +-
 settings/roy.py                             |  4 ++--
 templates/gracedb/event_detail.html         |  1 -
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/gracedb/management/commands/ingest_email.py b/gracedb/management/commands/ingest_email.py
index d6539b90f..e6bcff197 100644
--- a/gracedb/management/commands/ingest_email.py
+++ b/gracedb/management/commands/ingest_email.py
@@ -11,10 +11,10 @@ wierdchars = re.compile(u'[\U00010000-\U0010ffff]')
 def sendResponse(to, subject, message):
     msg = MIMEText(message)
     msg['To'] = to
-    msg['From'] = 'embb@losc-gracedb.ligo.org'
+    msg['From'] = 'embb@embb-dev.ligo.caltech.edu'
     msg['Subject'] = subject
     s = smtplib.SMTP('acrux.ligo.caltech.edu')
-    s.sendmail('embb@losc-gracedb.ligo.org', [to], msg.as_string())
+    s.sendmail('embb@embb-dev.ligo.caltech.edu', [to], msg.as_string())
     s.quit()
     return None
 
@@ -69,8 +69,13 @@ class Command(BaseCommand):
             
         
 # look for the JSON field at the end of the mail
-        j = json.loads(dict['JSON'])
-        self.transcript += 'Found %d keys in JSON\n' % len(j.keys())
+        try:
+            j = json.loads(dict['JSON'])
+            self.transcript += 'Found %d keys in JSON\n' % len(j.keys())
+        except Exception, e:
+            self.transcript += 'Error: Cannot parse JSON: %s\n' % dict['JSON']
+            self.transcript += str(e)
+            return sendResponse(dict['From'], dict['Subject'], self.transcript)
 
         graceid = getpop(j, 'graceid', None)
         try:
diff --git a/settings/default.py b/settings/default.py
index b727dcbb1..ad5e74b62 100644
--- a/settings/default.py
+++ b/settings/default.py
@@ -40,7 +40,7 @@ XMPP_ALERT_CHANNELS = [
                         'external_grb',
                       ]
 
-SKYMAP_VIEWER_SERVICE_URL = "https://losc-gracedb.ligo.org/cgi-bin/skymapViewer"
+SKYMAP_VIEWER_SERVICE_URL = "https://embb-dev.ligo.caltech.edu/cgi-bin/skymapViewer"
 
 BLESSED_TAGS = [
                  'analyst_comments',
diff --git a/settings/roy.py b/settings/roy.py
index 3ce1c007f..d075d3491 100644
--- a/settings/roy.py
+++ b/settings/roy.py
@@ -30,13 +30,13 @@ SKYMAP_VIEWER_MEDIA_URL = "/skymap-viewer/"
 GRACEDB_DATA_DIR = "/home/roywilliams/gracedbData"
 MPLCONFIGDIR = "/home/jkanner/mplconfig"
 
-ALERT_EMAIL_FROM = "Dev Alert <root@losc-gracedb.ligo.org>"
+ALERT_EMAIL_FROM = "Dev Alert <root@embb-dev.ligo.caltech.edu>"
 ALERT_EMAIL_TO = [
     "Roy Williams <roy@caltech.edu>",
     ]
 ALERT_EMAIL_BCC = ["roy@caltech.edu"]
 
-ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@losc-gracedb.ligo.org>"
+ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@embb-dev.ligo.caltech.edu>"
 ALERT_TEST_EMAIL_TO = [
     "Roy Williams <roy@caltech.edu>",
     ]
diff --git a/templates/gracedb/event_detail.html b/templates/gracedb/event_detail.html
index 5b55c0862..c9232c1eb 100644
--- a/templates/gracedb/event_detail.html
+++ b/templates/gracedb/event_detail.html
@@ -629,7 +629,6 @@
 {# Enable post to skymap viewer #}
 <div id="sV_form_div" style="display: none">
 
-<!-- <form action="https://losc-gracedb.ligo.org/cgi-bin/skymapViewer" id="sV_form"  method="post"> -->
 <form action="{{ SKYMAP_VIEWER_SERVICE_URL }}" id="sV_form"  method="post">
     <input type="hidden" name="skymapid" value="{{ object.graceid }}">
     <!-- <input type="hidden" name="json" value="{{ skymap_json }}"> -->
-- 
GitLab