Skip to content

Commit

Permalink
Merge pull request #71 from revolter/fix/incorrect-subscription-updat…
Browse files Browse the repository at this point in the history
…e-message
  • Loading branch information
revolter authored Feb 8, 2022
2 parents e3a78ce + 5fccf24 commit 1acd8ee
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,17 @@ def subscribe_command_handler(update: telegram.Update, context: telegram.ext.Cal
if db_user is None:
return

db_user.subscription = database.User.Subscription.accepted.value
db_user.save()
if db_user.subscription != database.User.Subscription.accepted.value:
db_user.subscription = database.User.Subscription.accepted.value
db_user.save()

subscription_update_message = db_user.get_subscription_update_message()
subscription_update_message = db_user.get_subscription_update_message()

telegram_utils.send_subscription_update_message(
bot=telegram_queue_bot,
chat_id=ADMIN_USER_ID,
text=subscription_update_message
)
telegram_utils.send_subscription_update_message(
bot=telegram_queue_bot,
chat_id=ADMIN_USER_ID,
text=subscription_update_message
)

utils.send_subscription_accepted_message_if_needed(
bot=bot,
Expand Down

0 comments on commit 1acd8ee

Please sign in to comment.