We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a093a2 commit 29b75c0Copy full SHA for 29b75c0
netbox_scripthelper/api/serializers.py
@@ -30,7 +30,13 @@ class AvailableIPSerializer(serializers.Serializer):
30
Representation of an IP address which does not exist in the database.
31
"""
32
def to_representation(self, instance):
33
+ with_mask = self.context['request'].query_params.get('with_mask', 'True')
34
+
35
+ value = f"{instance}/{self.context['parent'].mask_length}"
36
+ if with_mask == 'False':
37
+ value = str(instance)
38
39
return {
- 'id': f"{instance}/{self.context['parent'].mask_length}",
- 'display': f"{instance}/{self.context['parent'].mask_length}",
40
+ 'id': value,
41
+ 'display': value,
42
}
0 commit comments