Generalize with-user into if-user #149

amalloy opened this Issue Oct 6, 2011 · 0 comments

1 participant

4clojure member

When I first wrote with-user I had in mind that it would be used only to perform tasks that are illegal without a logged-in user, like logging out or submitting a new problem. But all over the codebase I see stuff like (if (session/session-get :user) (with-user [...] (...handle logged-in user...) (...handle no user...)). This tells me my original abstraction was wrong, so I'm going to implement (if-user [binding] ...) as basically an if-let. Should be simple, but I'm making an Issue so that I remember to do it and also update the existing uses of with-user.

@amalloy amalloy was assigned Oct 6, 2011
@amalloy amalloy closed this in bc124ae Oct 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment