Skip to content

Commit

Permalink
Saving data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Apr 15, 2024
1 parent 9a00476 commit 3f138d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions social/utils/telegram_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def approve_telegram_group(update: Update):
logger.error("Telegram group not validated (secret=%s, group=%s)", text, group)
return
text = text.removeprefix('/validate').removeprefix('@ViribusSocialBot').strip()
db.session.query(CreateGroupRequest).where(CreateGroupRequest.secret_key == text).update(
{CreateGroupRequest.mapped_group_id: group.id}
)
request = db.session.query(CreateGroupRequest).where(CreateGroupRequest.secret_key == text).one_or_none()
request.mapped_group_id=group.id
group.owner_id = request.owner_id
db.session.commit()
logger.info("Telegram group %d validated (secret=%s)", group.id, text)

0 comments on commit 3f138d5

Please sign in to comment.