Rename flag_updated_at_as_modified to dont_change_updated_at

main
Vincent Kling 2 years ago
parent bda404182f
commit 6b785abb01

@ -33,7 +33,7 @@ def dovecot_quota(ns, user_email):
user = models.User.query.get(user_email) or flask.abort(404) user = models.User.query.get(user_email) or flask.abort(404)
if ns == "storage": if ns == "storage":
user.quota_bytes_used = flask.request.get_json() user.quota_bytes_used = flask.request.get_json()
user.flag_updated_at_as_modified() user.dont_change_updated_at()
models.db.session.commit() models.db.session.commit()
return flask.jsonify(None) return flask.jsonify(None)

@ -155,7 +155,7 @@ class Base(db.Model):
self.__hashed = id(self) if primary is None else hash(primary) self.__hashed = id(self) if primary is None else hash(primary)
return self.__hashed return self.__hashed
def flag_updated_at_as_modified(self): def dont_change_updated_at(self):
""" Mark updated_at as modified, but keep the old date when updating the model""" """ Mark updated_at as modified, but keep the old date when updating the model"""
flag_modified(self, 'updated_at') flag_modified(self, 'updated_at')

Loading…
Cancel
Save