Skip to content

Commit

Permalink
Trim whitespace from pgp key if a pgp key is present
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Nov 18, 2012
1 parent 9bf0073 commit 2b3d0f8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/clojars/web/user.clj
Expand Up @@ -95,15 +95,16 @@
(submit-button "Update"))))) (submit-button "Update")))))


(defn update-profile [account {:keys [email password confirm ssh-key pgp-key]}] (defn update-profile [account {:keys [email password confirm ssh-key pgp-key]}]
(if-let [errors (apply validate {:email email (let [pgp-key (and pgp-key (.trim pgp-key))]
:username account (if-let [errors (apply validate {:email email
:password password :username account
:ssh-key ssh-key :password password
:pgp-key pgp-key} :ssh-key ssh-key
(update-user-validations confirm))] :pgp-key pgp-key}
(profile-form account (apply concat (vals errors))) (update-user-validations confirm))]
(do (update-user account email account password ssh-key pgp-key) (profile-form account (apply concat (vals errors)))
(redirect "/profile")))) (do (update-user account email account password ssh-key pgp-key)
(redirect "/profile")))))


(defn show-user [account user] (defn show-user [account user]
(html-doc account (h (user :user)) (html-doc account (h (user :user))
Expand Down

0 comments on commit 2b3d0f8

Please sign in to comment.