Commit e88141db authored by Maël Kervella's avatar Maël Kervella

Pylint compliance on machines

parent 2114a6eb
......@@ -20,5 +20,8 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""machines
The app in charge of everything related to the machines, the interface, ...
"""
from .acl import *
......@@ -20,6 +20,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""machines.admin
The objects, fields and datastructures visible in the Django admin view
"""
from __future__ import unicode_literals
......@@ -44,74 +47,92 @@ from .models import (
class MachineAdmin(VersionAdmin):
""" Admin view of a Machine object """
pass
class Ipv6ListAdmin(VersionAdmin):
""" Admin view of a Ipv6List object """
pass
class IpTypeAdmin(VersionAdmin):
""" Admin view of a IpType object """
pass
class MachineTypeAdmin(VersionAdmin):
""" Admin view of a MachineType object """
pass
class VlanAdmin(VersionAdmin):
""" Admin view of a Vlan object """
pass
class ExtensionAdmin(VersionAdmin):
""" Admin view of a Extension object """
pass
class SOAAdmin(VersionAdmin):
""" Admin view of a SOA object """
pass
class MxAdmin(VersionAdmin):
""" Admin view of a MX object """
pass
class NsAdmin(VersionAdmin):
""" Admin view of a NS object """
pass
class TxtAdmin(VersionAdmin):
""" Admin view of a TXT object """
pass
class SrvAdmin(VersionAdmin):
""" Admin view of a SRV object """
pass
class NasAdmin(VersionAdmin):
""" Admin view of a Nas object """
pass
class IpListAdmin(VersionAdmin):
""" Admin view of a Ipv4List object """
pass
class OuverturePortAdmin(VersionAdmin):
""" Admin view of a OuverturePort object """
pass
class OuverturePortListAdmin(VersionAdmin):
""" Admin view of a OuverturePortList object """
pass
class InterfaceAdmin(VersionAdmin):
""" Admin view of a Interface object """
list_display = ('machine', 'type', 'mac_address', 'ipv4', 'details')
class DomainAdmin(VersionAdmin):
""" Admin view of a Domain object """
list_display = ('interface_parent', 'name', 'extension', 'cname')
class ServiceAdmin(VersionAdmin):
""" Admin view of a ServiceAdmin object """
list_display = ('service_type', 'min_time_regen', 'regular_time_regen')
......
......@@ -137,10 +137,10 @@ class AliasForm(FormRevMixin, ModelForm):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
user = kwargs.pop('user')
super(AliasForm, self).__init__(*args, prefix=prefix, **kwargs)
can_use_all, reason = Extension.can_use_all(user)
can_use_all, _reason = Extension.can_use_all(user)
if not can_use_all:
self.fields['extension'].queryset = Extension.objects.filter(
need_infra=False
need_infra=False
)
......@@ -480,6 +480,8 @@ class ServiceForm(FormRevMixin, ModelForm):
))
def save(self, commit=True):
# TODO : None of the parents of ServiceForm use the commit
# parameter in .save()
instance = super(ServiceForm, self).save(commit=False)
if commit:
instance.save()
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,10 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""machines.tests
The tests for the API module.
"""
from django.test import TestCase
# from django.test import TestCase
# Create your tests here.
......@@ -20,6 +20,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""machines.urls
The defined URLs for the Cotisations app
"""
from __future__ import unicode_literals
......
This diff is collapsed.
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