add renew to tutorial
This commit is contained in:
@@ -44,14 +44,14 @@ class Customer(BaseModel):
|
||||
return True
|
||||
|
||||
def renew_keys(self) -> bool:
|
||||
attrs_before = self.attributes.attr_vals.copy()
|
||||
sets_before = self.attributes.set_vals.copy()
|
||||
old_attrs = self.attributes.attr_vals.copy()
|
||||
old_sets = self.attributes.set_vals.copy()
|
||||
self.attributes.renew()
|
||||
attrs_after = self.attributes.attr_vals
|
||||
sets_after = self.attributes.set_vals
|
||||
new_attrs = self.attributes.attr_vals
|
||||
new_sets = self.attributes.set_vals
|
||||
|
||||
attrs_xor = xor_lists(attrs_after, attrs_before)
|
||||
set_xor = xor_lists(sets_after, sets_before)
|
||||
attrs_xor = xor_lists(new_attrs, old_attrs)
|
||||
set_xor = xor_lists(new_sets, old_sets)
|
||||
for user in self.users.values():
|
||||
user.renew_keys(set_xor, attrs_xor)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user