diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md
index fffb247b2..94c53409a 100644
--- a/docs/release-notes/version-3.0.md
+++ b/docs/release-notes/version-3.0.md
@@ -7,6 +7,7 @@
* [#7153](https://github.com/netbox-community/netbox/issues/7153) - Allow clearing of assigned device type images
* [#7164](https://github.com/netbox-community/netbox/issues/7164) - Fix styling of "decommissioned" label for circuits
* [#7169](https://github.com/netbox-community/netbox/issues/7169) - Fix CSV import file upload
+* [#7169](https://github.com/netbox-community/netbox/issues/7193) - Fix prefix (flat) template issue when viewing child prefixes with prefixes available
---
diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py
index e4bb7d693..5afb6a9c9 100644
--- a/netbox/ipam/tables.py
+++ b/netbox/ipam/tables.py
@@ -25,6 +25,15 @@ PREFIX_LINK = """
{{ record.prefix }}
"""
+PREFIXFLAT_LINK = """
+{% load helpers %}
+{% if record.pk %}
+ {{ record.prefix }}
+{% else %}
+ —
+{% endif %}
+"""
+
PREFIX_ROLE_LINK = """
{% if record.role %}
{{ record.role }}
@@ -281,10 +290,10 @@ class PrefixTable(BaseTable):
template_code=PREFIX_LINK,
attrs={'td': {'class': 'text-nowrap'}}
)
- prefix_flat = tables.Column(
- accessor=Accessor('prefix'),
- linkify=True,
- verbose_name='Prefix (Flat)'
+ prefix_flat = tables.TemplateColumn(
+ template_code=PREFIXFLAT_LINK,
+ attrs={'td': {'class': 'text-nowrap'}},
+ verbose_name='Prefix (Flat)',
)
depth = tables.Column(
accessor=Accessor('_depth'),