diff options
Diffstat (limited to 'dashboard/src/account/models.py')
-rw-r--r-- | dashboard/src/account/models.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dashboard/src/account/models.py b/dashboard/src/account/models.py index bfeead0..4fc7c40 100644 --- a/dashboard/src/account/models.py +++ b/dashboard/src/account/models.py @@ -61,7 +61,7 @@ class VlanManager(models.Model): new_vlan = vlans.index(1) # will throw if none available vlans[new_vlan] = 0 allocated.append(new_vlan) - if count is 1: + if count == 1: return allocated[0] return allocated @@ -94,7 +94,7 @@ class VlanManager(models.Model): vlan_master_list = json.loads(self.vlans) try: iter(vlans) - except: + except Exception: vlans = [vlans] for vlan in vlans: @@ -112,7 +112,7 @@ class VlanManager(models.Model): try: iter(vlans) - except: + except Exception: vlans = [vlans] for vlan in vlans: @@ -125,13 +125,13 @@ class VlanManager(models.Model): try: iter(vlans) - except: + except Exception: vlans = [vlans] vlans = set(vlans) for vlan in vlans: - if my_vlans[vlan] is 0: + if my_vlans[vlan] == 0: raise ValueError("vlan " + str(vlan) + " is not available") my_vlans[vlan] = 0 |