Browse Source

device=user fix

Hal De 4 years ago
parent
commit
c01482d8f0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/app.py

+ 2 - 0
app/app.py

@@ -632,6 +632,8 @@ async def unbindOtherDevices(user, newDevice, ast):
   devices = await amiDBGet('AMPUSER', '{}/device'.format(user))
   devices = await amiDBGet('AMPUSER', '{}/device'.format(user))
   if devices not in NONEs:
   if devices not in NONEs:
     for _device in sorted(set(devices.split('&')), key=int):
     for _device in sorted(set(devices.split('&')), key=int):
+      if _device == user:
+        continue
       if _device != newDevice:
       if _device != newDevice:
         if ast.FMDEVSTATE == 'TRUE':
         if ast.FMDEVSTATE == 'TRUE':
           await amiSetVar('DEVICE_STATE(Custom:FOLLOWME{})'.format(_device), 'INVALID')
           await amiSetVar('DEVICE_STATE(Custom:FOLLOWME{})'.format(_device), 'INVALID')