Use Django's smarter if tag.

Review Request #2834 — Created Jan. 29, 2012 and submitted

Information

Review Board

Reviewers

Use Django's smarter if tag.

Django these days provides a smarter if tag that allows for basic
expressions. This is nicer than using ifequal for things, and with
Django 1.4, we can also do elif. This cleans up bits of the code and
allows some expressions and nested ifs to be condensed.
I checked a few pages, but haven't checked everything. I'd like a pair
of eyes on every line of my change to be sure I didn't do something
stupid. We'll also want to just test this a lot before beta.
Description From Last Updated

Not 100% sure, but I think this comment can now be removed.

ME medanat

Why is this line commented out?

ME medanat

One less indent here.

ME medanat

One less indent here.

ME medanat

One less indent for both of these lines.

ME medanat

One less indent here.

ME medanat

One less indent here.

ME medanat

Insert one indent here.

ME medanat

Insert one indent here.

ME medanat

single space after added_by. i.e.: added_by %}

ME medanat
ME
  1. The transition seems correct (to me).
    I found some indentation style issues while trying to match if statements (mostly from code you didn't alter), but that's minor.
    
    Yazan
  2. One less indent here.
  3. One less indent here.
  4. One less indent for both of these lines.
  5. 
      
ME
  1. More code maintenance: I don't know if these issues should be brought up in this review, but I can't help but spot them while going through the code.
    
    Yazan
  2. Not 100% sure, but I think this comment can now be removed.
    1. Yeah, this should be tackled in a separate change. Good catch, though!
  3. Why is this line commented out?
    1. Hah. Debugging info. Harmless, but yeah, probably could go. Separate change.
  4. single space after added_by.
    
    i.e.: added_by %}
  5. 
      
david
  1. Aside from the style issues that Yazan found, this looks fine to me.
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (b6951bf)
Loading...