'Accept requests to update the theme preview.'

@method_decorator(login_required)
def post(self, request, **kwargs):

    if (not user_can_preview_themes(request.user)):
        raise Http404
    action = request.POST.get('action', None)
    if (action == 'set_preview_theme'):
        preview_theme_name = request.POST.get(PREVIEW_THEME_FIELD, '')
        set_user_preview_site_theme(request, preview_theme_name)
    elif (action == 'reset_preview_theme'):
        set_user_preview_site_theme(request, None)
    return redirect(request.path)
