mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-27 01:13:46 +00:00
Merge branch 'fix_cnames' into 'dev'
Fix cnames See merge request federez/re2o!238
This commit is contained in:
commit
5723d39af0
2 changed files with 3 additions and 5 deletions
|
@ -816,13 +816,12 @@ class CNAMERecordSerializer(serializers.ModelSerializer):
|
||||||
"""Serialize `machines.models.Domain` objects with the data needed to
|
"""Serialize `machines.models.Domain` objects with the data needed to
|
||||||
generate a CNAME DNS record.
|
generate a CNAME DNS record.
|
||||||
"""
|
"""
|
||||||
alias = serializers.CharField(source='cname.name', read_only=True)
|
alias = serializers.CharField(source='cname', read_only=True)
|
||||||
hostname = serializers.CharField(source='name', read_only=True)
|
hostname = serializers.CharField(source='name', read_only=True)
|
||||||
extension = serializers.CharField(source='extension.name', read_only=True)
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = machines.Domain
|
model = machines.Domain
|
||||||
fields = ('alias', 'hostname', 'extension')
|
fields = ('alias', 'hostname')
|
||||||
|
|
||||||
|
|
||||||
class DNSZonesSerializer(serializers.ModelSerializer):
|
class DNSZonesSerializer(serializers.ModelSerializer):
|
||||||
|
|
|
@ -712,8 +712,7 @@ class Extension(RevMixin, AclMixin, models.Model):
|
||||||
from re2o.utils import all_active_assigned_interfaces
|
from re2o.utils import all_active_assigned_interfaces
|
||||||
return (Domain.objects
|
return (Domain.objects
|
||||||
.filter(extension=self)
|
.filter(extension=self)
|
||||||
.filter(cname__isnull=False)
|
.filter(cname__interface_parent__in=all_active_assigned_interfaces())
|
||||||
.filter(interface_parent__in=all_active_assigned_interfaces())
|
|
||||||
.prefetch_related('cname'))
|
.prefetch_related('cname'))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue