about summary refs log tree commit diff
path: root/web
diff options
context:
space:
mode:
authorglittershark <grfn@gws.fyi>2020-08-09T18·36+0000
committerglittershark <grfn@gws.fyi>2020-08-09T19·02+0000
commit1fd633dffdd3ccccad5f1bc9713c7f434fe249ae (patch)
tree549b5f05f1f1365e5228c2df6556641909eec588 /web
parentd1653533a6f6f70d1d95001abf3f80665ba135e7 (diff)
fix(web/panettone): revert "implement shorthand issue URLs" r/1628
This reverts commit 311511385455f680aedf78aab761fcebf3ca7731.

Reason for revert: this is causing all issues to return a 404 - reverting until we can get it working.

Change-Id: I5f3c5ec3b24f245a1f7ef12645200d16ed0f1b35
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1721
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Diffstat (limited to 'web')
-rw-r--r--web/panettone/src/model.lisp2
-rw-r--r--web/panettone/src/panettone.lisp20
2 files changed, 6 insertions, 16 deletions
diff --git a/web/panettone/src/model.lisp b/web/panettone/src/model.lisp
index a606174dabd4..300ee19b6b10 100644
--- a/web/panettone/src/model.lisp
+++ b/web/panettone/src/model.lisp
@@ -155,7 +155,7 @@ its new value will be formatted using ~A into NEW-VALUE"))
 (define-condition issue-not-found (error)
   ((id :type integer
        :initarg :id
-       :reader id
+       :reader not-found-id
        :documentation "ID of the issue that was not found"))
   (:documentation
    "Error condition for when an issue requested by ID is not found"))
diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp
index cf9c608b077c..7594c3ab2408 100644
--- a/web/panettone/src/panettone.lisp
+++ b/web/panettone/src/panettone.lisp
@@ -369,9 +369,8 @@
              (render/new-comment (id issue))))))))))
 
 (defun render/not-found (entity-type)
-  (setf (hunchentoot:return-code*) 404)
   (render ()
-    (:h1 (who:esc entity-type) " Not Found")))
+    (:h1 (who:esc entity-type) "Not Found")))
 
 ;;;
 ;;; HTTP handlers
@@ -453,12 +452,10 @@
 (defroute show-issue
     ("/issues/:id" :decorators (@auth-optional @handle-issue-not-found))
     (&path (id 'integer))
-  (when id
-    (let* ((issue (model:get-issue id))
-           (*title* (format nil "~A | Panettone"
-                            (subject issue))))
-      (render/issue issue))
-    (render/not-found "Issue")))
+  (let* ((issue (model:get-issue id))
+         (*title* (format nil "~A | Panettone"
+                          (subject issue))))
+    (render/issue issue)))
 
 (defroute edit-issue
     ("/issues/:id/edit" :decorators (@auth @handle-issue-not-found))
@@ -519,13 +516,6 @@
   (setf (hunchentoot:content-type*) "text/css")
   (apply #'lass:compile-and-write panettone.css:styles))
 
-(defroute shorthand-issue
-    ("/:id" :decorators (@auth-optional))
-    (&path (id 'integer))
-  (if id
-      (hunchentoot:redirect (format nil "/issues/~A" id))
-      (render/not-found "Route")))
-
 (defvar *acceptor* nil
   "Hunchentoot acceptor for Panettone's web server.")