Commit 0065e2e0 authored by Maël Kervella's avatar Maël Kervella
Browse files

Fix unused variables in kwargs

parent 1469c7d6
......@@ -224,7 +224,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
@receiver(post_save, sender=Facture)
def facture_post_save(_sender, **kwargs):
def facture_post_save(**kwargs):
Synchronise the LDAP user after an invoice has been saved.
......@@ -234,7 +234,7 @@ def facture_post_save(_sender, **kwargs):
@receiver(post_delete, sender=Facture)
def facture_post_delete(_sender, **kwargs):
def facture_post_delete(**kwargs):
Synchronise the LDAP user after an invoice has been deleted.
......@@ -416,7 +416,7 @@ class Vente(RevMixin, AclMixin, models.Model):
# TODO : change vente to purchase
@receiver(post_save, sender=Vente)
def vente_post_save(_sender, **kwargs):
def vente_post_save(**kwargs):
Creates a 'cotisation' related object if needed and synchronise the
LDAP user when a purchase has been saved.
......@@ -434,7 +434,7 @@ def vente_post_save(_sender, **kwargs):
# TODO : change vente to purchase
@receiver(post_delete, sender=Vente)
def vente_post_delete(_sender, **kwargs):
def vente_post_delete(**kwargs):
Synchronise the LDAP user after a purchase has been deleted.
......@@ -683,7 +683,7 @@ class Cotisation(RevMixin, AclMixin, models.Model):
@receiver(post_save, sender=Cotisation)
def cotisation_post_save(_sender, **_kwargs):
def cotisation_post_save(**_kwargs):
Mark some services as needing a regeneration after the edition of a
cotisation. Indeed the membership status may have changed.
......@@ -695,7 +695,7 @@ def cotisation_post_save(_sender, **_kwargs):
@receiver(post_delete, sender=Cotisation)
def cotisation_post_delete(_sender, **_kwargs):
def cotisation_post_delete(**_kwargs):
Mark some services as needing a regeneration after the deletion of a
cotisation. Indeed the membership status may have changed.
......@@ -263,7 +263,7 @@ def new_facture_pdf(request):
# TODO : change facture to invoice
def facture_pdf(request, facture, _factureid):
def facture_pdf(request, facture, **_kwargs):
View used to generate a PDF file from an existing invoice in database
Creates a line for each Purchase (thus article sold) and generate the
......@@ -306,7 +306,7 @@ def facture_pdf(request, facture, _factureid):
# TODO : change facture to invoice
def edit_facture(request, facture, _factureid):
def edit_facture(request, facture, **_kwargs):
View used to edit an existing invoice.
Articles can be added or remove to the invoice and quantity
......@@ -347,7 +347,7 @@ def edit_facture(request, facture, _factureid):
# TODO : change facture to invoice
def del_facture(request, facture, _factureid):
def del_facture(request, facture, **_kwargs):
View used to delete an existing invocie.
......@@ -368,7 +368,7 @@ def del_facture(request, facture, _factureid):
def credit_solde(request, user, _userid):
def credit_solde(request, user, **_kwargs):
View used to edit the balance of a user.
Can be use either to increase or decrease a user's balance.
......@@ -425,7 +425,7 @@ def add_article(request):
def edit_article(request, article_instance, _articleid):
def edit_article(request, article_instance, **_kwargs):
View used to edit an article.
......@@ -489,7 +489,7 @@ def add_paiement(request):
# TODO : chnage paiement to Payment
def edit_paiement(request, paiement_instance, _paiementid):
def edit_paiement(request, paiement_instance, *_kwargs):
View used to edit a payment method.
......@@ -567,7 +567,7 @@ def add_banque(request):
# TODO : change banque to bank
def edit_banque(request, banque_instance, _bbanqueid):
def edit_banque(request, banque_instance, **_kwargs):
View used to edit a bank.
......@@ -1519,7 +1519,7 @@ class OuverturePort(RevMixin, AclMixin, models.Model):
@receiver(post_save, sender=Machine)
def machine_post_save(_sender, **kwargs):
def machine_post_save(**kwargs):
"""Synchronisation ldap et régen parefeu/dhcp lors de la modification
d'une machine"""
user = kwargs['instance'].user
......@@ -1529,7 +1529,7 @@ def machine_post_save(_sender, **kwargs):
@receiver(post_delete, sender=Machine)
def machine_post_delete(_sender, **kwargs):
def machine_post_delete(**kwargs):
"""Synchronisation ldap et régen parefeu/dhcp lors de la suppression
d'une machine"""
machine = kwargs['instance']
......@@ -1540,7 +1540,7 @@ def machine_post_delete(_sender, **kwargs):
@receiver(post_save, sender=Interface)
def interface_post_save(_sender, **kwargs):
def interface_post_save(**kwargs):
"""Synchronisation ldap et régen parefeu/dhcp lors de la modification
d'une interface"""
interface = kwargs['instance']
......@@ -1553,7 +1553,7 @@ def interface_post_save(_sender, **kwargs):
@receiver(post_delete, sender=Interface)
def interface_post_delete(_sender, **kwargs):
def interface_post_delete(**kwargs):
"""Synchronisation ldap et régen parefeu/dhcp lors de la suppression
d'une interface"""
interface = kwargs['instance']
......@@ -1562,7 +1562,7 @@ def interface_post_delete(_sender, **kwargs):
@receiver(post_save, sender=IpType)
def iptype_post_save(_sender, **kwargs):
def iptype_post_save(**kwargs):
"""Generation des objets ip après modification d'un range ip"""
iptype = kwargs['instance']
......@@ -1570,7 +1570,7 @@ def iptype_post_save(_sender, **kwargs):
@receiver(post_save, sender=MachineType)
def machinetype_post_save(_sender, **kwargs):
def machinetype_post_save(**kwargs):
"""Mise à jour des interfaces lorsque changement d'attribution
d'une machinetype (changement iptype parent)"""
machinetype = kwargs['instance']
......@@ -1579,84 +1579,84 @@ def machinetype_post_save(_sender, **kwargs):
@receiver(post_save, sender=Domain)
def domain_post_save(_sender, **_kwargs):
def domain_post_save(**_kwargs):
"""Regeneration dns après modification d'un domain object"""
@receiver(post_delete, sender=Domain)
def domain_post_delete(_sender, **_kwargs):
def domain_post_delete(**_kwargs):
"""Regeneration dns après suppression d'un domain object"""
@receiver(post_save, sender=Extension)
def extension_post_save(_sender, **_kwargs):
def extension_post_save(**_kwargs):
"""Regeneration dns après modification d'une extension"""
@receiver(post_delete, sender=Extension)
def extension_post_selete(_sender, **_kwargs):
def extension_post_selete(**_kwargs):
"""Regeneration dns après suppression d'une extension"""
@receiver(post_save, sender=SOA)
def soa_post_save(_sender, **_kwargs):
def soa_post_save(**_kwargs):
"""Regeneration dns après modification d'un SOA"""
@receiver(post_delete, sender=SOA)
def soa_post_delete(_sender, **_kwargs):
def soa_post_delete(**_kwargs):
"""Regeneration dns après suppresson d'un SOA"""
@receiver(post_save, sender=Mx)
def mx_post_save(_sender, **_kwargs):
def mx_post_save(**_kwargs):
"""Regeneration dns après modification d'un MX"""
@receiver(post_delete, sender=Mx)
def mx_post_delete(_sender, **_kwargs):
def mx_post_delete(**_kwargs):
"""Regeneration dns après suppresson d'un MX"""
@receiver(post_save, sender=Ns)
def ns_post_save(_sender, **_kwargs):
def ns_post_save(**_kwargs):
"""Regeneration dns après modification d'un NS"""
@receiver(post_delete, sender=Ns)
def ns_post_delete(_sender, **_kwargs):
def ns_post_delete(**_kwargs):
"""Regeneration dns après modification d'un NS"""
@receiver(post_save, sender=Txt)
def text_post_save(_sender, **_kwargs):
def text_post_save(**_kwargs):
"""Regeneration dns après modification d'un TXT"""
@receiver(post_delete, sender=Txt)
def text_post_delete(_sender, **_kwargs):
def text_post_delete(**_kwargs):
"""Regeneration dns après modification d'un TX"""
@receiver(post_save, sender=Srv)
def srv_post_save(_sender, **_kwargs):
def srv_post_save(**_kwargs):
"""Regeneration dns après modification d'un SRV"""
@receiver(post_delete, sender=Srv)
def srv_post_delete(_sender, **_kwargs):
def srv_post_delete(**_kwargs):
"""Regeneration dns après modification d'un SRV"""
......@@ -220,7 +220,7 @@ def generate_ipv4_mbf_param(form_obj, is_type_tt):
def new_machine(request, user, _userid):
def new_machine(request, user, **_kwargs):
""" Fonction de creation d'une machine. Cree l'objet machine,
le sous objet interface et l'objet domain à partir de model forms.
Trop complexe, devrait être simplifié"""
......@@ -264,7 +264,7 @@ def new_machine(request, user, _userid):
def edit_interface(request, interface_instance, _interfaceid):
def edit_interface(request, interface_instance, **_kwargs):
""" Edition d'une interface. Distingue suivant les droits les valeurs
de interfaces et machines que l'user peut modifier infra permet de
modifier le propriétaire"""
......@@ -316,7 +316,7 @@ def edit_interface(request, interface_instance, _interfaceid):
def del_machine(request, machine, _machineid):
def del_machine(request, machine, **_kwargs):
""" Supprime une machine, interfaces en mode cascade"""
if request.method == "POST":
......@@ -335,7 +335,7 @@ def del_machine(request, machine, _machineid):
def new_interface(request, machine, _machineid):
def new_interface(request, machine, **_kwargs):
""" Ajoute une interface et son domain associé à une machine existante"""
interface_form = AddInterfaceForm(request.POST or None, user=request.user)
......@@ -369,7 +369,7 @@ def new_interface(request, machine, _machineid):
def del_interface(request, interface, _interfaceid):
def del_interface(request, interface, **_kwargs):
""" Supprime une interface. Domain objet en mode cascade"""
if request.method == "POST":
machine = interface.machine
......@@ -391,7 +391,7 @@ def del_interface(request, interface, _interfaceid):
def new_ipv6list(request, interface, _interfaceid):
def new_ipv6list(request, interface, **_kwargs):
"""Nouvelle ipv6"""
ipv6list_instance = Ipv6List(interface=interface)
ipv6 = Ipv6ListForm(
......@@ -415,7 +415,7 @@ def new_ipv6list(request, interface, _interfaceid):
def edit_ipv6list(request, ipv6list_instance, _ipv6listid):
def edit_ipv6list(request, ipv6list_instance, **_kwargs):
"""Edition d'une ipv6"""
ipv6 = Ipv6ListForm(
request.POST or None,
......@@ -439,7 +439,7 @@ def edit_ipv6list(request, ipv6list_instance, _ipv6listid):
def del_ipv6list(request, ipv6list, _ipv6listid):
def del_ipv6list(request, ipv6list, **_kwargs):
""" Supprime une ipv6"""
if request.method == "POST":
interfaceid =
......@@ -476,7 +476,7 @@ def add_iptype(request):
def edit_iptype(request, iptype_instance, _iptypeid):
def edit_iptype(request, iptype_instance, **_kwargs):
""" Edition d'un range. Ne permet pas de le redimensionner pour éviter
......@@ -536,7 +536,7 @@ def add_machinetype(request):
def edit_machinetype(request, machinetype_instance, _machinetypeid):
def edit_machinetype(request, machinetype_instance, **_kwargs):
""" View used to edit a MachineType object """
machinetype = MachineTypeForm(
request.POST or None,
......@@ -598,7 +598,7 @@ def add_extension(request):
def edit_extension(request, extension_instance, _extensionid):
def edit_extension(request, extension_instance, **_kwargs):
""" View used to edit an Extension object """
extension = ExtensionForm(
request.POST or None,
......@@ -660,7 +660,7 @@ def add_soa(request):
def edit_soa(request, soa_instance, _soaid):
def edit_soa(request, soa_instance, **_kwargs):
""" View used to edit a SOA object """
soa = SOAForm(request.POST or None, instance=soa_instance)
if soa.is_valid():
......@@ -718,7 +718,7 @@ def add_mx(request):
def edit_mx(request, mx_instance, _mxid):
def edit_mx(request, mx_instance, **_kwargs):
""" View used to edit a MX object """
mx = MxForm(request.POST or None, instance=mx_instance)
if mx.is_valid():
......@@ -776,7 +776,7 @@ def add_ns(request):
def edit_ns(request, ns_instance, _nsid):
def edit_ns(request, ns_instance, **_kwargs):
""" View used to edit a NS object """
ns = NsForm(request.POST or None, instance=ns_instance)
if ns.is_valid():
......@@ -834,7 +834,7 @@ def add_txt(request):
def edit_txt(request, txt_instance, _txtid):
def edit_txt(request, txt_instance, **_kwargs):
""" View used to edit a TXT object """
txt = TxtForm(request.POST or None, instance=txt_instance)
if txt.is_valid():
......@@ -892,7 +892,7 @@ def add_srv(request):
def edit_srv(request, srv_instance, _srvid):
def edit_srv(request, srv_instance, **_kwargs):
""" View used to edit a SRV object """
srv = SrvForm(request.POST or None, instance=srv_instance)
if srv.is_valid():
......@@ -956,7 +956,7 @@ def add_alias(request, interface, interfaceid):
def edit_alias(request, domain_instance, _domainid):
def edit_alias(request, domain_instance, **_kwargs):
""" View used to edit an Alias object """
alias = AliasForm(
request.POST or None,
......@@ -1029,7 +1029,7 @@ def add_service(request):
def edit_service(request, service_instance, _serviceid):
def edit_service(request, service_instance, **_kwargs):
""" View used to edit a Service object """
service = ServiceForm(request.POST or None, instance=service_instance)
if service.is_valid():
......@@ -1087,7 +1087,7 @@ def add_vlan(request):
def edit_vlan(request, vlan_instance, _vlanid):
def edit_vlan(request, vlan_instance, **_kwargs):
""" View used to edit a VLAN object """
vlan = VlanForm(request.POST or None, instance=vlan_instance)
if vlan.is_valid():
......@@ -1145,7 +1145,7 @@ def add_nas(request):
def edit_nas(request, nas_instance, _nasid):
def edit_nas(request, nas_instance, **_kwargs):
""" View used to edit a NAS object """
nas = NasForm(request.POST or None, instance=nas_instance)
if nas.is_valid():
......@@ -1378,7 +1378,7 @@ def index_portlist(request):
def edit_portlist(request, ouvertureportlist_instance, _ouvertureportlistid):
def edit_portlist(request, ouvertureportlist_instance, **_kwargs):
""" View used to edit a port policy """
port_list = EditOuverturePortListForm(
request.POST or None,
......@@ -1417,7 +1417,7 @@ def edit_portlist(request, ouvertureportlist_instance, _ouvertureportlistid):
def del_portlist(request, port_list_instance, _ouvertureportlistid):
def del_portlist(request, port_list_instance, **_kwargs):
""" View used to delete a port policy """
messages.success(request, "La liste de ports a été supprimée")
......@@ -1457,7 +1457,7 @@ def add_portlist(request):
def configure_ports(request, interface_instance, _interfaceid):
def configure_ports(request, interface_instance, **_kwargs):
""" View to display the list of configured port policy for an
interface """
if not interface_instance.may_have_port_open():
......@@ -118,7 +118,7 @@ class OptionalUser(AclMixin, PreferencesModel):
@receiver(post_save, sender=OptionalUser)
def optionaluser_post_save(_sender, **kwargs):
def optionaluser_post_save(**kwargs):
"""Ecriture dans le cache"""
user_pref = kwargs['instance']
......@@ -163,7 +163,7 @@ class OptionalMachine(AclMixin, PreferencesModel):
@receiver(post_save, sender=OptionalMachine)
def optionalmachine_post_save(_sender, **kwargs):
def optionalmachine_post_save(**kwargs):
"""Synchronisation ipv6 et ecriture dans le cache"""
machine_pref = kwargs['instance']
......@@ -211,7 +211,7 @@ class OptionalTopologie(AclMixin, PreferencesModel):
@receiver(post_save, sender=OptionalTopologie)
def optionaltopologie_post_save(_sender, **kwargs):
def optionaltopologie_post_save(**kwargs):
"""Ecriture dans le cache"""
topologie_pref = kwargs['instance']
......@@ -251,7 +251,7 @@ class GeneralOption(AclMixin, PreferencesModel):
@receiver(post_save, sender=GeneralOption)
def generaloption_post_save(_sender, **kwargs):
def generaloption_post_save(**kwargs):
"""Ecriture dans le cache"""
general_pref = kwargs['instance']
......@@ -325,7 +325,7 @@ class AssoOption(AclMixin, PreferencesModel):
@receiver(post_save, sender=AssoOption)
def assooption_post_save(_sender, **kwargs):
def assooption_post_save(**kwargs):
"""Ecriture dans le cache"""
asso_pref = kwargs['instance']
......@@ -136,7 +136,7 @@ def add_service(request):
def edit_service(request, service_instance, _serviceid):
def edit_service(request, service_instance, **_kwargs):
"""Edition des services affichés sur la page d'accueil"""
service = ServiceForm(request.POST or None, instance=service_instance)
if service.is_valid():
......@@ -411,18 +411,18 @@ class Room(AclMixin, RevMixin, models.Model):
@receiver(post_save, sender=AccessPoint)
def ap_post_save(_sender, **_kwargs):
def ap_post_save(**_kwargs):
"""Regeneration des noms des bornes vers le controleur"""
@receiver(post_delete, sender=AccessPoint)
def ap_post_delete(_sender, **_kwargs):
def ap_post_delete(**_kwargs):
"""Regeneration des noms des bornes vers le controleur"""
@receiver(post_delete, sender=Stack)
def stack_post_delete(_sender, **_kwargs):
def stack_post_delete(**_kwargs):
"""Vide les id des switches membres d'une stack supprimée"""
......@@ -296,7 +296,7 @@ def new_port(request, switchid):
def edit_port(request, port_object, _portid):
def edit_port(request, port_object, **_kwargs):
""" Edition d'un port. Permet de changer le switch parent et
l'affectation du port"""
......@@ -322,7 +322,7 @@ def edit_port(request, port_object, _portid):
def del_port(request, port, _portid):
def del_port(request, port, **_kwargs):
""" Supprime le port"""
if request.method == "POST":
......@@ -358,7 +358,7 @@ def new_stack(request):
def edit_stack(request, stack, _stackid):
def edit_stack(request, stack, **_kwargs):
"""Edition d'un stack (nombre de switches, nom...)"""
stack = StackForm(request.POST or None, instance=stack)
if stack.is_valid():
......@@ -374,7 +374,7 @@ def edit_stack(request, stack, _stackid):
def del_stack(request, stack, _stackid):
def del_stack(request, stack, **_kwargs):
"""Supprime un stack"""
if request.method == "POST":
......@@ -392,7 +392,7 @@ def del_stack(request, stack, _stackid):
def edit_switchs_stack(request, stack, _stackid):
def edit_switchs_stack(request, stack, **_kwargs):
"""Permet d'éditer la liste des switches dans une stack et l'ajouter"""
if request.method == "POST":
......@@ -599,7 +599,7 @@ def new_ap(request):
def edit_ap(request, ap, _accesspointid):
def edit_ap(request, ap, **_kwargs):
""" Edition d'un switch. Permet de chambre nombre de ports,
place dans le stack, interface et machine associée"""
interface_form = EditInterfaceForm(
......@@ -668,7 +668,7 @@ def new_room(request):
def edit_room(request, room, _roomid):
def edit_room(request, room, **_kwargs):
""" Edition numero et details de la chambre"""
room = EditRoomForm(request.POST or None, instance=room)
if room.is_valid():
......@@ -685,7 +685,7 @@ def edit_room(request, room, _roomid):
def del_room(request, room, _roomid):
def del_room(request, room, **_kwargs):
""" Suppression d'un chambre"""
if request.method == "POST":
......@@ -723,7 +723,7 @@ def new_model_switch(request):
def edit_model_switch(request, model_switch, _modelswitchid):
def edit_model_switch(request, model_switch, **_kwargs):
""" Edition d'un modèle de switch"""
model_switch = EditModelSwitchForm(
......@@ -744,7 +744,7 @@ def edit_model_switch(request, model_switch, _modelswitchid):
def del_model_switch(request, model_switch, _modelswitchid):
def del_model_switch(request, model_switch, **_kwargs):
""" Suppression d'un modèle de switch"""
if request.method == "POST":
......@@ -782,7 +782,7 @@ def new_switch_bay(request):