diff --git a/cotisations/templates/cotisations/factures.tex b/cotisations/templates/cotisations/factures.tex index 9647f466..03b8351f 100644 --- a/cotisations/templates/cotisations/factures.tex +++ b/cotisations/templates/cotisations/factures.tex @@ -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 diff --git a/machines/serializers.py b/machines/serializers.py index 51ff2483..f21f1d41 100644 --- a/machines/serializers.py +++ b/machines/serializers.py @@ -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) diff --git a/machines/views.py b/machines/views.py index b9cbbc5a..c8ed1155 100644 --- a/machines/views.py +++ b/machines/views.py @@ -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) diff --git a/re2o/settings.py b/re2o/settings.py index c648b23f..e11d899a 100644 --- a/re2o/settings.py +++ b/re2o/settings.py @@ -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 = '/' diff --git a/templates/base.html b/templates/base.html index df27577c..aa7222dd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% bootstrap_css %} {% bootstrap_javascript %} - +