Задать вопрос

Тел: +7 965 3737 888





Redirect with change list with filters intact with admin actions

When using the django admin as a means of moderating reviews on a site, the obvious choice was to use admin actions and do everything from a single screen. The I stumbled across was that after the actions were peformed, the app redirected to the change list without any filters. This meant that filtering on un-moderated reviews was lost as soon as a change was made.

It turns out that the solution is pretty simple, you just put a redirect to request.get_full_path() at the end of the admin action. I think this should be the default behaviour, but the fix is simple nonetheless.

Вопрос полезен? Да0/Нет0

Ответы (1):

Ответ полезен? Да0/Нет0

The indentation for line 11 is probably wrong.