[WIP] Synchronize manually from a remote node

This commit is contained in:
Pablo
2018-10-11 19:12:33 +02:00
parent 924bbcc38b
commit ed43be57b0
3 changed files with 22 additions and 1 deletions

View File

@@ -119,6 +119,7 @@ class HotelNodeUser(models.Model):
:param dict vals: a dictionary of fields to update and the value to set on them.
:raise: ValidationError
"""
for rec in self:
if 'node_id' in vals and vals['node_id'] != rec.node_id.id:
msg = _("Changing a user between nodes is not allowed. Please create a new user instead.")
@@ -143,6 +144,9 @@ class HotelNodeUser(models.Model):
remote_vals = {}
if 'login' in vals:
remote_vals.update({'login': vals['login']})
if 'active' in vals:
remote_vals.update({'active': vals['active']})