8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-27 07:02:26 +00:00

Fix #95 by removing duplicates classes and functions

This commit is contained in:
Maël Kervella 2018-04-13 17:30:48 +00:00
parent badad16376
commit aa7ded9f20
3 changed files with 7 additions and 20 deletions

View file

@ -659,9 +659,8 @@ def cotisation_post_save(sender, **kwargs):
regen('mailing') regen('mailing')
# TODO : should be name cotisation_post_delete
@receiver(post_delete, sender=Cotisation) @receiver(post_delete, sender=Cotisation)
def vente_post_delete(sender, **kwargs): def cotisation_post_delete(sender, **kwargs):
""" """
Mark some services as needing a regeneration after the deletion of a Mark some services as needing a regeneration after the deletion of a
cotisation. Indeed the membership status may have changed. cotisation. Indeed the membership status may have changed.

View file

@ -1452,7 +1452,7 @@ def iptype_post_save(sender, **kwargs):
@receiver(post_save, sender=MachineType) @receiver(post_save, sender=MachineType)
def machine_post_save(sender, **kwargs): def machinetype_post_save(sender, **kwargs):
"""Mise à jour des interfaces lorsque changement d'attribution """Mise à jour des interfaces lorsque changement d'attribution
d'une machinetype (changement iptype parent)""" d'une machinetype (changement iptype parent)"""
machinetype = kwargs['instance'] machinetype = kwargs['instance']
@ -1539,7 +1539,7 @@ def srv_post_save(sender, **kwargs):
@receiver(post_delete, sender=Srv) @receiver(post_delete, sender=Srv)
def text_post_delete(sender, **kwargs): def srv_post_delete(sender, **kwargs):
"""Regeneration dns après modification d'un SRV""" """Regeneration dns après modification d'un SRV"""
regen('dns') regen('dns')

View file

@ -56,19 +56,6 @@ from .forms import (
) )
class UserAdmin(admin.ModelAdmin):
"""Administration d'un user"""
list_display = (
'surname',
'pseudo',
'email',
'school',
'shell',
'state'
)
search_fields = ('surname', 'pseudo')
class LdapUserAdmin(admin.ModelAdmin): class LdapUserAdmin(admin.ModelAdmin):
"""Administration du ldapuser""" """Administration du ldapuser"""
list_display = ('name', 'uidNumber', 'login_shell') list_display = ('name', 'uidNumber', 'login_shell')
@ -143,7 +130,8 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
'is_admin', 'is_admin',
'shell' 'shell'
) )
list_display = ('pseudo',) # Need to reset the settings from BaseUserAdmin
# They are using fields we don't use like 'is_staff'
list_filter=() list_filter=()
fieldsets = ( fieldsets = (
(None, {'fields': ('pseudo', 'password')}), (None, {'fields': ('pseudo', 'password')}),
@ -175,7 +163,7 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
} }
), ),
) )
search_fields = ('pseudo',) search_fields = ('pseudo', 'surname')
ordering = ('pseudo',) ordering = ('pseudo',)
filter_horizontal = () filter_horizontal = ()