mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-27 01:36:11 -06:00
12074 fix set location only if present in rack
This commit is contained in:
parent
941c4df9d9
commit
7225dbf049
@ -799,7 +799,7 @@ class Device(PrimaryModel, ConfigContextModel):
|
|||||||
if is_new and not self.airflow:
|
if is_new and not self.airflow:
|
||||||
self.airflow = self.device_type.airflow
|
self.airflow = self.device_type.airflow
|
||||||
|
|
||||||
if self.rack:
|
if self.rack and self.rack.location:
|
||||||
self.location = self.rack.location
|
self.location = self.rack.location
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user