title: If, elif > too many conditions
body: <p>I have here several conditions and 'sub-conditions'. It looks quite messy and I wonder if you know a better way to write this code here?</p>
  
  <pre><code>def form_valid(self, form):
      instance = form.instance
  
      # Conditions
      if instance.available_amount &lt;= instance.redeemed_amount:
          instance.status = Discount.STATUS_NO_MORE_LEFT
      elif instance.valid_until &lt;= timezone.now():
          instance.status = Discount.STATUS_EXPIRED
  
      # Conditions to set active
      elif instance.status == Discount.STATUS_NO_MORE_LEFT:
          if instance.available_amount &gt; instance.redeemed_amount:
              instance.status = Discount.STATUS_ACTIVE
      elif instance.status == Discount.STATUS_EXPIRED:
          if instance.valid_until &gt; timezone.now():
              instance.status = Discount.STATUS_ACTIVE
  </code></pre>