mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 16:23:16 +08:00
Set user.sender_format_updated_at when user updates sender_format
This commit is contained in:
parent
0354943ff4
commit
5bb0ae0234
2 changed files with 3 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
import arrow
|
||||
from flask import jsonify, g, request
|
||||
|
||||
from app.api.base import api_bp, require_api_auth
|
||||
|
@ -68,6 +69,7 @@ def update_setting():
|
|||
return jsonify(error="Invalid sender_format"), 400
|
||||
|
||||
user.sender_format = SenderFormatEnum.get_value(sender_format)
|
||||
user.sender_format_updated_at = arrow.now()
|
||||
|
||||
if "random_alias_default_domain" in data:
|
||||
default_domain = data["random_alias_default_domain"]
|
||||
|
|
|
@ -238,6 +238,7 @@ def setting():
|
|||
sender_format = int(request.form.get("sender-format"))
|
||||
if SenderFormatEnum.has_value(sender_format):
|
||||
current_user.sender_format = sender_format
|
||||
current_user.sender_format_updated_at = arrow.now()
|
||||
db.session.commit()
|
||||
flash("Your sender format preference has been updated", "success")
|
||||
db.session.commit()
|
||||
|
|
Loading…
Reference in a new issue