forked from django-cms/django-cms
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into yakky-feature/multidb_test
Conflicts: cms/test_utils/cli.py runtests.py
- Loading branch information
Showing
211 changed files
with
17,482 additions
and
13,184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = '2.3.3.post0' | ||
__version__ = '2.3.4.post0' | ||
|
||
# patch settings | ||
try: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
from cms.admin.dialog.forms import PermissionAndModeratorForm, PermissionForm, ModeratorForm | ||
from cms.admin.dialog.forms import PermissionForm | ||
from cms.models import Page | ||
from django.conf import settings | ||
from django.contrib.admin.views.decorators import staff_member_required | ||
from django.http import Http404, HttpResponse | ||
from django.shortcuts import render_to_response, get_object_or_404 | ||
|
||
def _form_class_selector(): | ||
''' | ||
This replaces the magic that used to happen in forms, where a dynamic | ||
class was generated at runtime. Now it's a bit cleaner... | ||
''' | ||
form_class = None | ||
if settings.CMS_PERMISSION and settings.CMS_MODERATOR: | ||
form_class = PermissionAndModeratorForm | ||
elif settings.CMS_PERMISSION: | ||
form_class = PermissionForm | ||
elif settings.CMS_MODERATOR: | ||
form_class = ModeratorForm | ||
return form_class | ||
|
||
@staff_member_required | ||
def get_copy_dialog(request, page_id): | ||
if not (settings.CMS_PERMISSION or settings.CMS_MODERATOR): | ||
if not settings.CMS_PERMISSION: | ||
return HttpResponse('') | ||
|
||
page = get_object_or_404(Page, pk=page_id) | ||
target = get_object_or_404(Page, pk=request.REQUEST['target']) | ||
|
||
if not page.has_change_permission(request) or \ | ||
not target.has_add_permission(request): # pragma: no cover | ||
not target.has_add_permission(request): | ||
raise Http404 | ||
|
||
context = { | ||
'dialog_id': 'dialog-copy', | ||
'form': _form_class_selector()(), # class needs to be instanciated | ||
'form': PermissionForm(), # class needs to be instantiated | ||
'callback': request.REQUEST['callback'], | ||
} | ||
return render_to_response("admin/cms/page/dialog/copy.html", context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.