Commit bbc00fdb authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root
Browse files

Ajoute unicode literals + attribue les ip à l'enregistrement auto en fonction du nas

parent 3a1b4c3b
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.contrib import admin
from reversion.admin import VersionAdmin
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django import forms
from django.forms import ModelForm, Form
from django import forms
......
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save, post_delete
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
......
......@@ -23,6 +23,8 @@
# App de gestion des users pour re2o
# Goulven Kermarec, Gabriel Détraz
# Gplv2
from __future__ import unicode_literals
from django.shortcuts import render, redirect
from django.shortcuts import get_object_or_404
from django.template.context_processors import csrf
......
......@@ -32,6 +32,8 @@ Inspirés d'autres exemples trouvés ici :
https://github.com/FreeRADIUS/freeradius-server/blob/master/src/modules/rlm_python/
"""
from __future__ import unicode_literals
import logging
import netaddr
import radiusd # Module magique freeradius (radiusd.py is dummy)
......@@ -238,8 +240,9 @@ def detach(_=None):
def decide_vlan_and_register_macauth(switch_id, port_number, mac_address):
# Get port from switch and port number
switch = Switch.objects.filter(switch_interface=Interface.objects.filter(Q(ipv4=IpList.objects.filter(ipv4=switch_id)) | Q(domain=Domain.objects.filter(name=switch_id))))
if not switch:
ipv4 = IpList.objects.filter(ipv4=switch_id)
switch = Switch.objects.filter(switch_interface=Interface.objects.filter(Q(ipv4=ipv4) | Q(domain=Domain.objects.filter(name=switch_id))))
if not switch or not ipv4:
return ('?', 'Switch inconnu', VLAN_OK)
sw_name = str(switch.first().switch_interface)
......
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.db import models
# Create your models here.
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
......
......@@ -23,6 +23,9 @@
# App de gestion des statistiques pour re2o
# Gabriel Détraz
# Gplv2
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.shortcuts import get_object_or_404
......
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.contrib import admin
from reversion.admin import VersionAdmin
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.forms import ModelForm, Form, ValidationError
from django import forms
from .models import Domain, Machine, Interface, IpList, MachineType, Extension, Mx, Text, Ns, Service, Vlan, Nas, IpType
......
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save, pre_delete, post_delete
from django.dispatch import receiver
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
......
......@@ -23,6 +23,9 @@
# App de gestion des machines pour re2o
# Gabriel Détraz, Augustin Lemesle
# Gplv2
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.shortcuts import get_object_or_404
......
......@@ -21,6 +21,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.contrib import admin
from reversion.admin import VersionAdmin
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.forms import ModelForm, Form, ValidationError
from django import forms
from .models import OptionalUser, OptionalMachine, OptionalTopologie, GeneralOption, AssoOption, MailMessageOption, Service
......
......@@ -21,6 +21,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.db import models
from cotisations.models import Paiement
......
......@@ -20,6 +20,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
......
......@@ -24,6 +24,7 @@
# Gabriel Détraz, Augustin Lemesle
# Gplv2
from __future__ import unicode_literals
from django.shortcuts import render
from django.shortcuts import get_object_or_404, render, redirect
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment