Browse files

Improve settings-page UX

  • Loading branch information...
1 parent 5d3789b commit fd2cc0314933469345a8233133f27a67d274be98 @amalloy amalloy committed Oct 9, 2011
Showing with 5 additions and 2 deletions.
  1. +3 −1 resources/public/css/style.css
  2. +2 −1 src/foreclojure/settings.clj
@@ -313,7 +313,9 @@ div#main {
div.message #flash-text {}
-div.message #error-text {}
+div.message #error-text {
+ color: red;
div#prob-title {
font-size: 15pt;
@@ -80,7 +80,8 @@
"New password must be at least seven characters long",
(= new-pwd repeat-pwd)
"New password was not entered identically twice"
- (.checkPassword encryptor old-pwd pwd)
+ (or (empty? new-pwd)

amcnamara Oct 9, 2011


empty? new-pwd is redundant with line 79 (which itself is a redundant check because empty str has .length < 6)


amalloy Oct 9, 2011


You're right about 79 itself being redundant, provided that new-pwd is never nil (I'm not sure if that's a safe assumption).

But we definitely do need the check here, because we are willing to accept an empty password - it signifies "no desire to change passwords". If we didn't have the empty? check then empty passwords would be checked against the DB, always failing; you would thus have to enter your password to get anything at all done here.

+ (.checkPassword encryptor old-pwd pwd))
"Current password incorrect"
(not (empty? email))
"Please enter a valid email address"]

0 comments on commit fd2cc03

Please sign in to comment.