Skip to content

Commit

Permalink
log changes of a user's email_lang preference
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Nov 30, 2024
1 parent 774d76d commit 5c2e49c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions liberapay/models/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,10 +1367,12 @@ def dequeue(msg, status):
""")

def set_email_lang(self, lang, cursor=None):
(cursor or self.db).run(
"UPDATE participants SET email_lang=%s WHERE id=%s",
(lang, self.id)
)
with self.db.get_cursor(cursor=cursor) as c:
c.run(
"UPDATE participants SET email_lang=%s WHERE id=%s",
(lang, self.id)
)
self.add_event(c, 'set_email_lang', lang)
self.set_attributes(email_lang=lang)


Expand Down

0 comments on commit 5c2e49c

Please sign in to comment.