Skip to content

Commit

Permalink
port-fix: get_object call was missing request argument (#7318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiky30 committed May 16, 2022
1 parent dbec622 commit 732bf94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -9,6 +9,7 @@
* Backported from develop: Added support for Github Actions based CI.
* Backported from develop: Added Support for testing frontend, docs, test and linting in different/parallel CI pipelines.
* Backported from develop: Remove travis integration from the project as the project has moved to Github Actions.
* Backported from develop-4: Fixed usage of ``get_object`` in ``edit_title_fields`` of the page admin.


=== 3.6.0 (unreleased) ===
Expand Down
6 changes: 3 additions & 3 deletions cms/admin/pageadmin.py
Expand Up @@ -705,16 +705,16 @@ def copy_page(self, request, page_id):
page_languages = page.get_languages()
site_languages = get_language_list(site_id=site.pk)

if not any(lang in page_languages for lang in site_languages):
if not any(lang in page_languages for lang in site_languages):
message = force_str(_("Error! The page you're pasting is not "
"translated in any of the languages configured by the target site."))
"translated in any of the languages configured by the target site."))
return jsonify_request(HttpResponseBadRequest(message))

new_page = form.copy_page()
return HttpResponse(json.dumps({"id": new_page.pk}), content_type='application/json')

def edit_title_fields(self, request, page_id, language):
page = self.get_object(page_id)
page = self.get_object(request, object_id=page_id)
translation = page.get_title_obj(language, fallback=False)

if not self.has_change_permission(request, obj=page):
Expand Down

0 comments on commit 732bf94

Please sign in to comment.