Fixed update bug in CorpContact admin selects
The problem is that Django RelatedObjectLookups.js is triggering select changes for the initial value and we don't want to change the contact list for this initial change (unless we lose the currently selected value).
This commit is contained in:
parent
f39724f551
commit
579236986e
3 changed files with 6 additions and 4 deletions
|
|
@ -360,7 +360,7 @@ class PeriodAdmin(admin.ModelAdmin):
|
|||
|
||||
|
||||
class AvailabilityAdmin(admin.ModelAdmin):
|
||||
list_display = ('corporation', 'period', 'domain')
|
||||
list_display = ('corporation', 'period', 'domain', 'contact')
|
||||
list_filter = ('period',)
|
||||
fields = (('corporation', 'period'), 'domain', 'contact', 'priority', 'comment')
|
||||
form = AvailabilityAdminForm
|
||||
|
|
@ -370,7 +370,7 @@ class AvailabilityAdmin(admin.ModelAdmin):
|
|||
kwargs["queryset"] = Corporation.objects.filter(archived=False).order_by('name')
|
||||
if db_field.name == "contact":
|
||||
kwargs["queryset"] = CorpContact.objects.filter(archived=False)
|
||||
return super(AvailabilityAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
|
||||
return super().formfield_for_foreignkey(db_field, request, **kwargs)
|
||||
|
||||
|
||||
class TrainingAdmin(admin.ModelAdmin):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue