gwu-libraries/DigOp — Issue #12: clean up a variables in views.py
Author: dchud
Created: 2012-02-21 16:39:00+00:00
State: open

A few notes:

* instead of assigning request.user to a variable, remember that it's always available at request.user both in views and at template processing time
* remove variables that are no longer used
* name variables consistently, eg. sometimes a Book instance is "book", and sometimes "b"... I'd suggest going with the consistent and clear choice, "book", in all cases.
* pass dicts around (especially to templates) with clear key names rather than building up tuples/sequences

One last thought - don't leave blocks of commented-out code in, remove it before committing. Version control (branches, diffs, etc.) can always help you remember what used to be there.