Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix guest -> real account upgrade with account validity enabled (#6359)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 authored Nov 14, 2019
1 parent 6e1b40d commit 745a486
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/6359.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where upgrading a guest account to a full user would fail when account validity is enabled.
9 changes: 3 additions & 6 deletions synapse/storage/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,11 @@ def set_expiration_date_for_user_txn(self, txn, user_id, use_delta=False):
expiration_ts,
)

self._simple_insert_txn(
self._simple_upsert_txn(
txn,
"account_validity",
values={
"user_id": user_id,
"expiration_ts_ms": expiration_ts,
"email_sent": False,
},
keyvalues={"user_id": user_id},
values={"expiration_ts_ms": expiration_ts, "email_sent": False},
)

def start_profiling(self):
Expand Down

0 comments on commit 745a486

Please sign in to comment.