maas/images/maas-region-controller/2.3_partitiontable_does_not...

14 lines
591 B
Diff

diff --git a/src/maasserver/api/partitions.py b/src/maasserver/api/partitions.py
index fb75600a8..f03fc5685 100644
--- a/src/maasserver/api/partitions.py
+++ b/src/maasserver/api/partitions.py
@@ -89,7 +89,7 @@ class PartitionsHandler(OperationsHandler):
"""
device = BlockDevice.objects.get_block_device_or_404(
system_id, device_id, request.user, NODE_PERMISSION.VIEW)
- partition_table = device.partitiontable_set.get()
+ partition_table = device.get_partitiontable()
if partition_table is None:
return []
else: