From d2b8b0dd94a3e5097afdd44525f0f7d332c88321 Mon Sep 17 00:00:00 2001 From: Christian Mueller Date: Fri, 28 Mar 2014 22:05:08 +0100 Subject: [PATCH] tests fixed --- src/notehub/handler.clj | 8 ++++---- src/notehub/storage.clj | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/notehub/handler.clj b/src/notehub/handler.clj index e9d57d4..f48d40c 100644 --- a/src/notehub/handler.clj +++ b/src/notehub/handler.clj @@ -93,14 +93,14 @@ (response 500))) (response 400))) - (POST "/update-note" [note-id note password] + (POST "/update-note" [noteID note password] (let [pid "NoteHub" psk (storage/get-psk pid) - params {:noteID note-id :note note :password password :pid pid}] + params {:noteID noteID :note note :password password :pid pid}] (if (storage/valid-publisher? pid) (let [resp (api/update-note (assoc params - :signature - (storage/sign pid psk note-id note password)))] + :signature + (storage/sign pid psk noteID note password)))] (if (get-in resp [:status :success]) (redirect (:longURL resp)) (response 403))) diff --git a/src/notehub/storage.clj b/src/notehub/storage.clj index 63de504..3dd1d97 100644 --- a/src/notehub/storage.clj +++ b/src/notehub/storage.clj @@ -36,10 +36,9 @@ (redis :hset :publisher-key pid psk) psk))) -; This was uncommented, because the DB isn't -; available on heroku at compile time -#_ (when-not (valid-publisher? "NoteHub") - (register-publisher "NoteHub")) +(when (and (get-setting :dev-mode) + (not (valid-publisher? "NoteHub")) + (register-publisher "NoteHub"))) (defn revoke-publisher [pid] (redis :hdel :publisher-key pid))