mercredi 13 juin 2018

Flake8 error `E712 comparison to True should be 'if cond is True:' or 'if cond:'` in django

I try to manage if condition in Django.

It's working fine but getting an error when trying to check with flake8 flake8 data/view.py

My condition like this:

if user.item.purchase.status == True:

Here user, item and purchase is model and status is a field of purchase.

I'm doing something wrong?

Flake8 error E712 comparison to True should be 'if cond is True:' or 'if cond:'

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire