[Rt-commit] r5139 - in rt/branches/3.5-TESTING: . html/REST/1.0/Forms/ticket

kevinr at bestpractical.com kevinr at bestpractical.com
Mon May 1 15:17:02 EDT 2006


Author: kevinr
Date: Mon May  1 15:17:01 2006
New Revision: 5139

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment
   rt/branches/3.5-TESTING/html/REST/1.0/dhandler

Log:
 r12275 at sad-girl-in-snow:  kevinr | 2006-04-24 20:44:24 -0400
 * Cleaned up the REST comment form and the dhandler a bit.


Modified: rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment
==============================================================================
--- rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment	(original)
+++ rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment	Mon May  1 15:17:01 2006
@@ -73,7 +73,7 @@
 ($action = $changes{Action}) =~ s/^(.)(.*)$/\U$1\L$2\E/;
 unless ($action =~ /^(?:Comment|Correspond)$/) {
     $e = 1;
-    $c = "# Invalid action: `$action'.\n";
+    $c = "# Invalid action: `$action'.";
     goto OUTPUT;
 }
 
@@ -129,7 +129,7 @@
          $ticket->CurrentUserHasRight("ReplyToTicket")))
 {
     $e = 1;
-    $c = "You are not allowed to $action on ticket $id.\n";
+    $c = "# You are not allowed to $action on ticket $id.";
     goto OUTPUT;
 }
 

Modified: rt/branches/3.5-TESTING/html/REST/1.0/dhandler
==============================================================================
--- rt/branches/3.5-TESTING/html/REST/1.0/dhandler	(original)
+++ rt/branches/3.5-TESTING/html/REST/1.0/dhandler	Mon May  1 15:17:01 2006
@@ -291,9 +291,13 @@
         # We won't pass $e through to compose, trusting instead that the
         # handler added suitable comments for the user.
         if ($e) {
-            $status = "409 Syntax Error" if @$o;
+            if (@$o) {
+                $status = "409 Syntax Error";
+            } 
+            else {
+                $status = "400 Bad Request";
+            }
             push @output, [ $c, $o, $k ];
-            #die("handler=$handler, id=$id, args=$args, format=$format, changes=$k");
         }
         else {
             push @comments, $c;


More information about the Rt-commit mailing list