8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 23:43:47 +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')
# TODO : should be name cotisation_post_delete
@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
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)
def machine_post_save(sender, **kwargs):
def machinetype_post_save(sender, **kwargs):
"""Mise à jour des interfaces lorsque changement d'attribution
d'une machinetype (changement iptype parent)"""
machinetype = kwargs['instance']
@ -1539,7 +1539,7 @@ def srv_post_save(sender, **kwargs):
@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"""
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):
"""Administration du ldapuser"""
list_display = ('name', 'uidNumber', 'login_shell')
@ -143,8 +130,9 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
'is_admin',
'shell'
)
list_display = ('pseudo',)
list_filter = ()
# Need to reset the settings from BaseUserAdmin
# They are using fields we don't use like 'is_staff'
list_filter=()
fieldsets = (
(None, {'fields': ('pseudo', 'password')}),
(
@ -175,7 +163,7 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
}
),
)
search_fields = ('pseudo',)
search_fields = ('pseudo', 'surname')
ordering = ('pseudo',)
filter_horizontal = ()