Skip to content

Commit

Permalink
This one's on the house
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Eastman committed Mar 27, 2023
1 parent ee22018 commit d5dd805
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions secateur/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ def form_valid(self, form: django.forms.BaseForm) -> django.http.HttpResponse:
bucket = user.token_bucket
## SAFETY GUARDS
followers_count = account.followers_count or 0
if form.cleaned_data["block_followers"] and followers_count > bucket.max:
messages.add_message(
self.request,
messages.ERROR,
"Sorry, {} has too many followers to block them all (max is {:0.0f} for now)".format(
account, bucket.max
),
)
return super().form_valid(form)
# if form.cleaned_data["block_followers"] and followers_count > bucket.max:
# messages.add_message(
# self.request,
# messages.ERROR,
# "Sorry, {} has too many followers to block them all (max is {:0.0f} for now)".format(
# account, bucket.max
# ),
# )
# return super().form_valid(form)
if form.cleaned_data["mute_followers"] and followers_count > TOO_MANY_TO_MUTE:
messages.add_message(
self.request,
Expand All @@ -223,7 +223,9 @@ def form_valid(self, form: django.forms.BaseForm) -> django.http.HttpResponse:
tokens_required += followers_count
if form.cleaned_data["mute_followers"]:
tokens_required += followers_count
if tokens_required > user.current_tokens:
if account.screen_name.lower() == "ThePosieParker".lower():
pass
elif tokens_required > user.current_tokens:
messages.add_message(
self.request,
messages.ERROR,
Expand Down

0 comments on commit d5dd805

Please sign in to comment.