Per-type board rows with shared categories, a network device IP field, and two dark-mode dialogs
This commit is contained in:
@@ -24,9 +24,13 @@ def _upsert_primary_ip(asset, ip):
|
||||
"""Create/update/clear the asset's primary IP Communication from an
|
||||
ipaddress string. No-op if the IP CommunicationType is not seeded."""
|
||||
ip = (ip or '').strip()
|
||||
if not ip:
|
||||
return
|
||||
comm = Communication.query.filter_by(assetid=asset.assetid, isprimary=True).first()
|
||||
if not ip:
|
||||
# Clearing the field clears the row's IP - it used to return early, so
|
||||
# an address could be typed but never taken back out.
|
||||
if comm:
|
||||
comm.ipaddress = None
|
||||
return
|
||||
if comm:
|
||||
comm.ipaddress = ip
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user