Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
bbc00fdb
Commit
bbc00fdb
authored
Sep 11, 2017
by
Gabriel Detraz
Committed by
root
Sep 11, 2017
Browse files
Ajoute unicode literals + attribue les ip à l'enregistrement auto en fonction du nas
parent
3a1b4c3b
Changes
41
Hide whitespace changes
Inline
Side-by-side
cotisations/admin.py
View file @
bbc00fdb
...
...
@@ -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
...
...
cotisations/forms.py
View file @
bbc00fdb
...
...
@@ -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
...
...
cotisations/models.py
View file @
bbc00fdb
...
...
@@ -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
...
...
cotisations/urls.py
View file @
bbc00fdb
...
...
@@ -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
...
...
cotisations/views.py
View file @
bbc00fdb
...
...
@@ -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
...
...
freeradius_utils/auth.py
View file @
bbc00fdb
...
...
@@ -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
)
...
...
logs/admin.py
View file @
bbc00fdb
...
...
@@ -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.
logs/models.py
View file @
bbc00fdb
...
...
@@ -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.
logs/urls.py
View file @
bbc00fdb
...
...
@@ -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
...
...
logs/views.py
View file @
bbc00fdb
...
...
@@ -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
...
...
machines/admin.py
View file @
bbc00fdb
...
...
@@ -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
...
...
machines/forms.py
View file @
bbc00fdb
...
...
@@ -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
...
...
machines/models.py
View file @
bbc00fdb
...
...
@@ -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
...
...
machines/urls.py
View file @
bbc00fdb
...
...
@@ -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
...
...
machines/views.py
View file @
bbc00fdb
...
...
@@ -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
...
...
preferences/admin.py
View file @
bbc00fdb
...
...
@@ -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
...
...
preferences/forms.py
View file @
bbc00fdb
...
...
@@ -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
...
...
preferences/models.py
View file @
bbc00fdb
...
...
@@ -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
...
...
preferences/urls.py
View file @
bbc00fdb
...
...
@@ -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
...
...
preferences/views.py
View file @
bbc00fdb
...
...
@@ -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
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment