Skip to content
Snippets Groups Projects
Commit 8b02218b authored by Christian Pointner's avatar Christian Pointner
Browse files

Merge branch 'master' into stable

parents 4313274e cb7893dd
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,17 @@ class ShowAdmin(admin.ModelAdmin):
'musicfocus',
)
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
try:
show_id = int(request.get_full_path().split('/')[-2])
except ValueError:
show_id = None
if db_field.name == 'predecessor' and show_id:
kwargs['queryset'] = Show.objects.exclude(pk=show_id)
return super(ShowAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
admin.site.register(BroadcastFormat, BroadcastFormatAdmin)
admin.site.register(MusicFocus, MusicFocusAdmin)
admin.site.register(ShowInformation, ShowInformationAdmin)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment