mirror of
https://github.com/codl/forget
synced 2025-01-14 00:13:21 +01:00
make sure to reset delete timer when enabling
This commit is contained in:
parent
e6ddf2f120
commit
cd13094bad
@ -130,7 +130,11 @@ export default {
|
||||
methods: {
|
||||
toggle(policy_enabled){
|
||||
policy_enabled = !policy_enabled;
|
||||
this.set({policy_enabled});
|
||||
let obj = {policy_enabled}
|
||||
if(policy_enabled){
|
||||
obj.next_delete = null;
|
||||
}
|
||||
this.set(obj);
|
||||
this.fire('toggle', policy_enabled);
|
||||
}
|
||||
},
|
||||
|
8
model.py
8
model.py
@ -135,6 +135,14 @@ class Account(TimestampMixin, RemoteIDMixin):
|
||||
return 0
|
||||
return value
|
||||
|
||||
@db.validates('policy_enabled')
|
||||
def reset_next_delete(self, key, enable):
|
||||
if not self.policy_enabled and enable:
|
||||
self.next_delete = (
|
||||
datetime.now(timezone.utc) + self.policy_delete_every)
|
||||
return enable
|
||||
|
||||
|
||||
# backref: tokens
|
||||
# backref: twitter_archives
|
||||
# backref: posts
|
||||
|
Loading…
Reference in New Issue
Block a user