--- a/src/newseasons/views/main.clj Wed Oct 05 21:50:06 2011 -0400
+++ b/src/newseasons/views/main.clj Wed Oct 05 21:54:22 2011 -0400
@@ -100,9 +100,12 @@
; Search ----------------------------------------------------------------------
(defpage [:get "/search"] {:keys [query]}
(login-required
- (let [results (unique-shows (itunes-search-show query))]
- (shows/store-raw-shows results)
- (t/search query results))))
+ (if (empty? query)
+ (do (flash! "Please enter something to search for.")
+ (resp/redirect "/"))
+ (let [results (unique-shows (itunes-search-show query))]
+ (shows/store-raw-shows results)
+ (t/search query results)))))
; Add -------------------------------------------------------------------------