Exceptions in django stop the flow?
<p>in my view I am executing this piece of code:</p>

<pre><code>try:
    activeterm = LeaseTerm.objects.get(lease=lease, is_active = True)
except LeaseTenant.DoesNotExist:
    activeterm = None
</code></pre>

<p>And I expected there will be no value in <code>LeaseTerm</code>  I will get exception but I am getting an error:</p>

<blockquote>
  <p>LeaseTerm matching query does not exist.</p>
</blockquote>

<p>But I expected that I have handled the exception and flow should continue.</p>

<p>What is my miss understanding?</p>

<p>Please retry with:</p>

<pre><code>try:
    activeterm = LeaseTerm.objects.get(lease=lease, is_active = True)
except LeaseTerm.DoesNotExist: # LeaseTerm
    activeterm = None
</code></pre>

python django