Skip to content

Commit

Permalink
Only deleting list from datastore when it is not anonymous (i.e., it …
Browse files Browse the repository at this point in the history
…was randomly generated)
  • Loading branch information
rbp committed Oct 27, 2012
1 parent 6191729 commit dc9b5da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/crowdsort/core.clj
Expand Up @@ -23,9 +23,13 @@
(memcache/put! "current-list" (:elements new-list))
(memcache/put! "current-list-owner-email" (:owner-email new-list))))

(declare get-list-owner-email)
(defn delete-current-list-object []
(let [current-list-object (first (ds/query :kind ListToSort :sort [:submission-time]))]
(ds/delete! current-list-object)))
;; FIXME: this is a hack. Let's have a better way of indicating whether the list is submitted
;; or randomly generated.
(if (not (nil? (get-list-owner-email)))
(ds/delete! current-list-object))))

;; Get from memcache
(defn get-list []
Expand Down

0 comments on commit dc9b5da

Please sign in to comment.