Skip to content
Browse files

Fixed some bugs related to user-attribute confusion

(user-attribute :foo) does not return a map, it just returns the attribute.
  • Loading branch information...
1 parent f5f081f commit 7b6e25f69e3ad34fcd7962e070ef54d0b88bbdd6 @chrismgray committed Dec 13, 2011
Showing with 3 additions and 4 deletions.
  1. +1 −1 src/foreclojure/problems.clj
  2. +2 −3 src/foreclojure/users.clj
View
2 src/foreclojure/problems.clj
@@ -121,7 +121,7 @@
(maybe-update [old-score] dec)))))))))
(defn store-completed-state! [username problem-id code]
- (let [{user-id :_id} ((user-attribute :_id) username)
+ (let [user-id ((user-attribute :_id) username)
current-time (java.util.Date.)]
(when (not-any? #{problem-id} (get-solved username))
(update! :users {:_id user-id} {:$addToSet {:solved problem-id}
View
5 src/foreclojure/users.clj
@@ -20,8 +20,7 @@
[:golfer])))
(defn get-user-id [name]
- (:_id
- ((user-attribute :_id) name)))
+ ((user-attribute :_id) name))
(defn get-users []
(from-mongo
@@ -63,7 +62,7 @@
(true? (:hide-solutions user)))
(defn email-address [username]
- (:email ((user-attribute :email) username)))
+ ((user-attribute :email) username))
(defn mailto [username]
(link-to (str "mailto:" (email-address username))

0 comments on commit 7b6e25f

Please sign in to comment.
Something went wrong with that request. Please try again.