From 46ba8f3c026f6d8a8e44ab8674084fe411c89583 Mon Sep 17 00:00:00 2001
From: Branson Stephens <stephenb@uwm.edu>
Date: Tue, 21 May 2013 16:22:39 -0500
Subject: [PATCH] adding alert option in writeLabel message body

---
 gracedb/api.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gracedb/api.py b/gracedb/api.py
index 2798fbfe3..f652ae20c 100644
--- a/gracedb/api.py
+++ b/gracedb/api.py
@@ -518,9 +518,13 @@ class EventLabel(APIView):
                 })
 
     def put(self, request, graceid, label):
-        #return Response("Not Implemented", status=status.HTTP_501_NOT_IMPLEMENTED)
         try:
-            rv = create_label(graceid, label, request.ligouser)
+            # Look for the alert option, which may or may not be in the body.
+            try:
+                alert = request.DATA.get('alert')
+            except:
+                alert = True
+            rv = create_label(graceid, label, request.ligouser, alert)
         except Event.DoesNotExist:
             msg = "No such Event '%s'" % graceid
             return Response(msg,status=status.HTTP_404_NOT_FOUND)
-- 
GitLab