Fix guest -> real account upgrade with account validity enabled (#6359)

hs/many-joined-members
Andrew Morgan 2019-11-14 12:02:05 +00:00 committed by GitHub
parent 6e1b40dc26
commit 745a48625d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

1
changelog.d/6359.bugfix Normal file
View File

@ -0,0 +1 @@
Fix bug where upgrading a guest account to a full user would fail when account validity is enabled.

View File

@ -361,14 +361,11 @@ class SQLBaseStore(object):
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):