filter sold attributions

This commit is contained in:
Ludovic Stephan 2016-10-28 14:15:37 -02:00
parent e408437ab1
commit 8d1f599577

View file

@ -229,11 +229,10 @@ class SpectacleReventeAdmin(admin.ModelAdmin):
actions_on_bottom = True actions_on_bottom = True
def transfer(self, request, queryset): def transfer(self, request, queryset):
for revente in queryset.all(): for revente in queryset.exclude(soldTo__isnull=True).all():
if revente.soldTo: attrib = revente.attribution
attrib = revente.attribution attrib.participant = revente.soldTo
attrib.participant = revente.soldTo attrib.save()
attrib.save()
transfer.short_description = "Transférer les reventes sélectionnées" transfer.short_description = "Transférer les reventes sélectionnées"
def reinit(self, request, queryset): def reinit(self, request, queryset):