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. Show all issues
    One less indent here.
  3. Show all issues
    One less indent here.
  4. Show all issues
    One less indent for both of these lines.
  5. Show all issues
    One less indent here.
  6. Show all issues
    One less indent here.
  7. Show all issues
    Insert one indent here.
  8. Show all issues
    Insert one indent here.
  9. 
      
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. Show all issues
    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. Show all issues
    Why is this line commented out?
    1. Hah. Debugging info. Harmless, but yeah, probably could go. Separate change.
  4. Show all issues
    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...