8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Merge branch 'stretch'

This commit is contained in:
Gabriel Detraz 2017-06-17 21:26:18 +02:00 committed by root
commit f1dab01fc5
5 changed files with 20 additions and 16 deletions

View file

@ -60,7 +60,7 @@
Siret : {{siret}}
\\ \\
{\bf À :} \tab {{dest.name}} {{dest.surname}} \\ % Invoice recipient
{\bf Adresse :} \tab {% if dest.room = None %} Aucune adresse renseignée {% else %}{{dest.room}}{% endif %} \\
{\bf Adresse :} \tab {% if dest.room == None %} Aucune adresse renseignée {% else %}{{dest.room}}{% endif %} \\
{\bf Date:} \tab {{DATE}} \\ % Invoice date

View file

@ -38,8 +38,9 @@ class IpListSerializer(serializers.ModelSerializer):
class InterfaceSerializer(serializers.ModelSerializer):
ipv4 = IpListSerializer(read_only=True)
mac_address = serializers.SerializerMethodField('get_macaddress')
domain = serializers.SerializerMethodField('get_dns')
extension = serializers.SerializerMethodField('get_extension')
extension = serializers.SerializerMethodField('get_interface_extension')
class Meta:
model = Interface
@ -48,9 +49,12 @@ class InterfaceSerializer(serializers.ModelSerializer):
def get_dns(self, obj):
return obj.domain.name
def get_extension(self, obj):
def get_interface_extension(self, obj):
return obj.domain.extension.name
def get_macaddress(self, obj):
return str(obj.mac_address)
class ExtensionNameField(serializers.RelatedField):
def to_representation(self, value):
return value.name
@ -73,22 +77,22 @@ class ExtensionSerializer(serializers.ModelSerializer):
return obj.origin.ipv4
class MxSerializer(serializers.ModelSerializer):
name = serializers.SerializerMethodField('get_name')
name = serializers.SerializerMethodField('get_mx_name')
zone = serializers.SerializerMethodField('get_zone_name')
class Meta:
model = Mx
fields = ('zone', 'priority', 'name')
def get_name(self, obj):
return obj.name
def get_mx_name(self, obj):
return str(obj.name)
def get_zone_name(self, obj):
return obj.zone.name
class NsSerializer(serializers.ModelSerializer):
zone = serializers.SerializerMethodField('get_zone_name')
ns = serializers.SerializerMethodField('get_interface_name')
ns = serializers.SerializerMethodField('get_domain_name')
class Meta:
model = Ns
@ -97,12 +101,12 @@ class NsSerializer(serializers.ModelSerializer):
def get_zone_name(self, obj):
return obj.zone.name
def get_interface_name(self, obj):
return obj.ns
def get_domain_name(self, obj):
return str(obj.ns)
class DomainSerializer(serializers.ModelSerializer):
extension = serializers.SerializerMethodField('get_zone_name')
cname = serializers.SerializerMethodField('get_cname')
cname = serializers.SerializerMethodField('get_cname_name')
class Meta:
model = Domain
@ -111,6 +115,6 @@ class DomainSerializer(serializers.ModelSerializer):
def get_zone_name(self, obj):
return obj.extension.name
def get_cname(self, obj):
return obj.cname
def get_cname_name(self, obj):
return str(obj.cname)

View file

@ -751,7 +751,7 @@ def mac_ip_list(request):
@login_required
@permission_required('serveur')
def alias(request):
alias = Domain.objects.filter(interface_parent=None).filter(cname=Domain.objects.filter(interface_parent__in=Interface.objects.exclude(ipv4=None))).select_related('extension').select_related('cname__extension')
alias = Domain.objects.filter(interface_parent=None).filter(cname__in=Domain.objects.filter(interface_parent__in=Interface.objects.exclude(ipv4=None))).select_related('extension').select_related('cname__extension')
seria = DomainSerializer(alias, many=True)
return JSONResponse(seria.data)

View file

@ -34,7 +34,7 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
from .settings_local import SECRET_KEY, DATABASES, DEBUG, ALLOWED_HOSTS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_BROWSER_XSS_FILTER, SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, CSRF_COOKIE_HTTPONLY, X_FRAME_OPTIONS, SESSION_COOKIE_AGE, ASSO_NAME, ASSO_ADDRESS_LINE1, ASSO_ADDRESS_LINE2, ASSO_SIRET, ASSO_EMAIL, ASSO_PHONE, LOGO_PATH, services_urls, REQ_EXPIRE_HRS, REQ_EXPIRE_STR, EMAIL_FROM, SITE_NAME, LDAP, MAIN_EXTENSION, GID_RANGES, UID_RANGES, ASSO_PSEUDO, SEARCH_RESULT, MAX_INTERFACES, MAX_ALIAS, VLAN_ID_LIST, RADIUS_VLAN_DECISION, ADMINS, SERVER_EMAIL, OPTIONNAL_APPS
from .settings_local import *
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -50,7 +50,7 @@ PASSWORD_HASHERS = (
)
AUTH_USER_MODEL = 'users.User'
LOGIN_URL = '/login'
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'

View file

@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% bootstrap_css %}
{% bootstrap_javascript %}
<link rel="stylesheet" href="{% static "/static/css/base.css" %}">
<link rel="stylesheet" href="{% static "/css/base.css" %}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ site_name }} : {% block title %}Accueil{% endblock %}</title>
</head>