fix(dgsi/user): Flatten the values_list instead of iterating over it
This commit is contained in:
parent
750b85d792
commit
8187c13db6
1 changed files with 5 additions and 1 deletions
|
@ -235,7 +235,11 @@ class User(AbstractUser):
|
|||
|
||||
self.vlan_id = min(
|
||||
set(range(settings.VLAN_ID_MIN, settings.VLAN_ID_MAX))
|
||||
- set(*User.objects.exclude(vlan_id__isnull=True).values_list("vlan_id"))
|
||||
- set(
|
||||
User.objects.exclude(vlan_id__isnull=True).values_list(
|
||||
"vlan_id", flat=True
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
# Preempt the vlan attribution
|
||||
|
|
Loading…
Add table
Reference in a new issue