Skip to content

Commit 1a8fd91

Browse files
author
peterfarrell
committed
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: cms/admin/pageadmin.py cms/admin/placeholderadmin.py
2 parents 1c5eb7b + eff8c00 commit 1a8fd91

File tree

569 files changed

+25738
-27899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

569 files changed

+25738
-27899
lines changed

AUTHORS

+2-1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ Contributors (based on gitlog) (440):
302302
* mrlundis
303303
* mvaerle
304304
* MW
305+
* Nelson Brochado
305306
* neoprolog
306307
* Nick Jones
307308
* Nickolay V. Shmyrev
@@ -460,4 +461,4 @@ Contributors (based on gitlog) (440):
460461
* zundoya
461462
* Óscar M. Lage
462463
* Øyvind Saltvik
463-
* Антон Евжаков
464+
* Антон Евжаков

CHANGELOG.txt

+19-6
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,7 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
292292
- Added list of retired core developers
293293
- Added branch policy documentaion
294294

295-
<<<<<<< HEAD
296-
=== 3.1 (unreleased) ===
297-
=======
298-
=== 3.0.8 (2015-01-11) ===
295+
==== 3.0.8 (2015-01-11) ===
299296
- Add require_parent option to CMS_PLACEHOLDER_CONF
300297
- Fix django-mptt version depenency to be PEP440 compatible
301298
- Fix some Django 1.4 compatibility issues
@@ -309,9 +306,25 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
309306
- Documentation fixes
310307
- Minor code cleanups
311308

312-
=== 3.0.9 (2015-01-11) ===
309+
==== 3.0.9 (2015-01-11) ===
313310
- Revert a change that caused a regression in toolbar login
314311
- Fix an error in a translated phrase
315312
- Fix error when moving items in the page tree
316313

317-
>>>>>>> upstream/support/3.0.x
314+
=== 3.0.10 (2015-02-14) ===
315+
- Improved Py3 compatibility
316+
- Improved the behavior when changing the operator's language
317+
- Numerous documentation updates
318+
- Revert a change that caused an issue with saving plugins in some browsers
319+
- Fix an issue where urls were not refreshed when a page slug changes
320+
- Fix an issue with FR translations
321+
- Fixed an issue preventing the correct rendering of custom contextual menu items for plugins
322+
- Fixed an issue relating to recovering deleted pages
323+
- Fixed an issue that caused the uncached placeholder tag to display cached content
324+
- Fixed an issue where extra slashed would appear in apphooked URLs when APPEND_SLASH=False
325+
- Fixed issues relating to the logout function
326+
327+
==== 3.1 (unreleased) ===
328+
- Removed django-mptt in favor of django-treebeard
329+
- Removed compatibility with Django 1.4 / 1.5
330+
- General code cleanup

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Open source enterprise content management system based on the django framework.
1818
.. ATTENTION:: This is the **develop** branch. It's the branch for features that
1919
will go into django CMS 3.1. The **master** branch is the current stable release,
2020
the one released on PyPI.
21-
21+
2222
**support/3.0.x** will be our *next stable release*, the most
2323
appropriate branch for fixes and patches that will go into the next **master**.
2424

cms/admin/change_list.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.contrib.admin.views.main import ChangeList, ALL_VAR, IS_POPUP_VAR, \
88
ORDER_TYPE_VAR, ORDER_VAR, SEARCH_VAR
99
from django.contrib.sites.models import Site
10-
import django
10+
1111

1212
COPY_VAR = "copy"
1313

@@ -45,7 +45,8 @@ class CMSChangeList(ChangeList):
4545
real_queryset = False
4646

4747
def __init__(self, request, *args, **kwargs):
48-
from cms.utils.plugins import current_site
48+
from cms.utils.helpers import current_site
49+
4950
self._current_site = current_site(request)
5051
super(CMSChangeList, self).__init__(request, *args, **kwargs)
5152
try:
@@ -58,29 +59,25 @@ def __init__(self, request, *args, **kwargs):
5859
request.session['cms_admin_site'] = self._current_site.pk
5960
self.set_sites(request)
6061

61-
def get_queryset(self, request=None):
62+
def get_queryset(self, request):
6263
if COPY_VAR in self.params:
6364
del self.params[COPY_VAR]
6465
if 'language' in self.params:
6566
del self.params['language']
6667
if 'page_id' in self.params:
6768
del self.params['page_id']
68-
if django.VERSION[1] > 3:
69-
qs = super(CMSChangeList, self).get_queryset(request).drafts()
70-
else:
71-
qs = super(CMSChangeList, self).get_queryset().drafts()
72-
if request:
73-
site = self.current_site()
74-
permissions = Page.permissions.get_change_id_list(request.user, site)
75-
if permissions != Page.permissions.GRANT_ALL:
76-
qs = qs.filter(pk__in=permissions)
77-
self.root_queryset = self.root_queryset.filter(pk__in=permissions)
78-
self.real_queryset = True
79-
qs = qs.filter(site=self._current_site)
69+
qs = super(CMSChangeList, self).get_queryset(request).drafts()
70+
site = self.current_site()
71+
permissions = Page.permissions.get_change_id_list(request.user, site)
72+
if permissions != Page.permissions.GRANT_ALL:
73+
qs = qs.filter(pk__in=permissions)
74+
self.root_queryset = self.root_queryset.filter(pk__in=permissions)
75+
self.real_queryset = True
76+
qs = qs.filter(site=self._current_site)
8077
return qs
8178

8279
def is_filtered(self):
83-
from cms.utils.plugins import SITE_VAR
80+
from cms.utils.helpers import SITE_VAR
8481
lookup_params = self.params.copy() # a dictionary of the query string
8582
for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, SITE_VAR, 'language', 'page_id'):
8683
if i in lookup_params:

cms/admin/forms.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from django import forms
3+
from django.contrib.auth import get_user_model
34
from django.contrib.auth.models import Permission
45
from django.contrib.contenttypes.models import ContentType
56
from django.contrib.sites.models import Site
@@ -8,14 +9,14 @@
89
from django.forms.util import ErrorList
910
from django.forms.widgets import HiddenInput
1011
from django.template.defaultfilters import slugify
12+
from django.utils.encoding import force_text
1113
from django.utils.translation import ugettext_lazy as _, get_language
1214

1315
from cms.apphook_pool import apphook_pool
1416
from cms.constants import PAGE_TYPES_ID
1517
from cms.forms.widgets import UserSelectAdminWidget, AppHookSelect
1618
from cms.models import Page, PagePermission, PageUser, ACCESS_PAGE, PageUserGroup, Title, EmptyTitle, \
1719
GlobalPagePermission
18-
from cms.utils.compat.dj import get_user_model, force_unicode
1920
from cms.utils.compat.forms import UserCreationForm
2021
from cms.utils.conf import get_cms_setting
2122
from cms.utils.i18n import get_language_tuple
@@ -30,7 +31,7 @@
3031

3132
def get_permission_acessor(obj):
3233
User = get_user_model()
33-
34+
3435
if isinstance(obj, (PageUser, User,)):
3536
rel_name = 'user_permissions'
3637
else:
@@ -113,7 +114,7 @@ def __init__(self, *args, **kwargs):
113114
def clean(self):
114115
cleaned_data = self.cleaned_data
115116
slug = cleaned_data.get('slug', '')
116-
117+
117118
page = self.instance
118119
lang = cleaned_data.get('language', None)
119120
# No language, can not go further, but validation failed already
@@ -146,7 +147,7 @@ def clean(self):
146147
if hasattr(exc, 'messages'):
147148
errors = exc.messages
148149
else:
149-
errors = [force_unicode(exc.message)]
150+
errors = [force_text(exc.message)]
150151
self._errors['slug'] = ErrorList(errors)
151152
return cleaned_data
152153

@@ -328,7 +329,7 @@ class PagePermissionInlineAdminForm(forms.ModelForm):
328329
"""
329330
Page permission inline admin form used in inline admin. Required, because
330331
user and group queryset must be changed. User can see only users on the same
331-
level or under him in choosen page tree, and users which were created by him,
332+
level or under him in choosen page tree, and users which were created by him,
332333
but aren't assigned to higher page level than current user.
333334
"""
334335
page = forms.ModelChoiceField(Page.objects.all(), label=_('user'), widget=HiddenInput(), required=True)
@@ -392,7 +393,7 @@ def clean(self):
392393
# check if access for childrens, or descendants is granted
393394
if can_add and self.cleaned_data['grant_on'] == ACCESS_PAGE:
394395
# this is a missconfiguration - user can add/move page to current
395-
# page but after he does this, he will not have permissions to
396+
# page but after he does this, he will not have permissions to
396397
# access this page anymore, so avoid this
397398
raise forms.ValidationError(_("Add page permission requires also "
398399
"access to children, or descendants, otherwise added page "
@@ -422,6 +423,7 @@ def save(self, commit=True):
422423
return instance
423424

424425
class Meta:
426+
fields = '__all__'
425427
model = PagePermission
426428

427429

@@ -441,6 +443,7 @@ def clean(self):
441443
return self.cleaned_data
442444

443445
class Meta:
446+
fields = '__all__'
444447
model = GlobalPagePermission
445448

446449

@@ -483,6 +486,7 @@ class PageUserForm(UserCreationForm, GenericCmsPermissionForm):
483486
'Send email notification to user about username or password change. Requires user email.'))
484487

485488
class Meta:
489+
fields = '__all__'
486490
model = PageUser
487491

488492
def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
@@ -537,7 +541,7 @@ def clean(self):
537541
return cleaned_data
538542

539543
def save(self, commit=True):
540-
"""Create user, assign him to staff users, and create permissions for
544+
"""Create user, assign him to staff users, and create permissions for
541545
him if required. Also assigns creator to user.
542546
"""
543547
Super = self._password_change and PageUserForm or UserCreationForm

0 commit comments

Comments
 (0)