Skip to content

Commit

Permalink
Do not use == for boolean comparisons (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r authored Feb 19, 2024
1 parent 7de8e73 commit 6463cee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion blt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
if not os.path.exists(AVATAR_PATH):
os.makedirs(AVATAR_PATH)

if DEBUG == True or TESTING:
if DEBUG or TESTING:
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}}
else:
if os.environ.get("MEMCACHIER_SERVERS", ""):
Expand Down
16 changes: 8 additions & 8 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def process_issue(self, user, obj, created, domain, tokenauth=False, score=3):
name = "support"
domain.email = email_to
domain.save()
if tokenauth == False:
if not tokenauth:
msg_plain = render_to_string(
"email/bug_added.txt",
{
Expand Down Expand Up @@ -1197,7 +1197,7 @@ def delete_issue(request, id):
if request.user.is_superuser or request.user == issue.user:
issue.delete()
messages.success(request, "Issue deleted")
if tokenauth == True:
if tokenauth:
return JsonResponse("Deleted", safe=False)
else:
return redirect("/")
Expand Down Expand Up @@ -3096,7 +3096,7 @@ def withdraw(request):
stripe.api_key = settings.STRIPE_TEST_SECRET_KEY
if wallet.account_id:
account = stripe.Account.retrieve(wallet.account_id)
if account.payouts_enabled == True:
if account.payouts_enabled:
balance = stripe.Balance.retrieve()
if balance.available[0].amount > payment.value * 100:
stripe.Transfer.create(
Expand Down Expand Up @@ -3179,7 +3179,7 @@ def stripe_connected(request, username):

stripe.api_key = settings.STRIPE_TEST_SECRET_KEY
account = stripe.Account.retrieve(wallet.account_id)
if account.payouts_enabled == True:
if account.payouts_enabled:
payment = Payment.objects.get(wallet=wallet, active=True)
balance = stripe.Balance.retrieve()
if balance.available[0].amount > payment.value * 100:
Expand Down Expand Up @@ -3780,10 +3780,10 @@ def get_context_data(self, **kwargs):
# if word.lower() == "type":
# flag_word = True
# continue
# if flag_word == False:
# if not flag_word:
# url = word
# continue
# if flag_word == True:
# if flag_word:
# label = word
# if part.get_content_maintype() == "multipart":
# continue
Expand Down Expand Up @@ -3815,9 +3815,9 @@ def get_context_data(self, **kwargs):
# error = True
# if token == "None":
# error = "TokenTrue"
# if image == False:
# if not image:
# error = True
# if error == True:
# if error:
# send_mail(
# "Error In Your Report",
# "There was something wrong with the mail you sent regarding the issue to be created. Please check the content and try again later !",
Expand Down

0 comments on commit 6463cee

Please sign in to comment.