Skip to content

Commit 0506425

Browse files
committed
PageAdmin.change_status() returns a json-encoded string in case it cannot publish the page for url clashing. See Issue 1166
1 parent b9f97d7 commit 0506425

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cms/admin/pageadmin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# -*- coding: utf-8 -*-
2+
import json
3+
from multiprocessing.dummy import dict, list
4+
from locale import str
25
from cms.admin.change_list import CMSChangeList
36
from cms.admin.dialog.views import get_copy_dialog
47
from cms.admin.forms import PageForm, PageAddForm
@@ -19,6 +22,8 @@
1922
placeholder as placeholder_utils, admin as admin_utils, cms_static_url)
2023
from copy import deepcopy
2124
from distutils.version import LooseVersion
25+
from coverage.backward import set
26+
from django import template
2227
from django.conf import settings
2328
from django.contrib import admin
2429
from django.contrib.admin.options import IncorrectLookupParameters
@@ -1063,7 +1068,7 @@ def change_status(self, request, page_id):
10631068
page.save()
10641069
return admin_utils.render_admin_menu_item(request, page)
10651070
except ValidationError,e:
1066-
return HttpResponseServerError(unicode(e))
1071+
return HttpResponseServerError(json.dumps(e.messages))
10671072
else:
10681073
return HttpResponseForbidden(unicode(_("You do not have permission to publish this page")))
10691074

0 commit comments

Comments
 (0)