Skip to content

Commit

Permalink
ci: Flake8 fixes (django-cms#7372)
Browse files Browse the repository at this point in the history
* Release 3.10.0 RC1 (django-cms#7215)

* [3.10.0rc1 release process] Bumped version to 3.10.0rc1
* [3.10.0rc1 release process] compilemessages
* [3.10.0rc1 release process] compiling new static files
* [3.10.0rc1 release process] updating latest docs

* Update release/3.10 from develop (django-cms#7219)

* Fix script typos (django-cms#7201)
* [refactor] Typos in release scripts
* This was correct.

Co-authored-by: Simon Krull <simondotunix@gmail.com>

* feat: Added concurrency option to github workflows (django-cms#7205)
* fix: Disable workflow concurrency to bring stability back to the CI (django-cms#7209)
* Upgrade Gulp and Nodejs (django-cms#7208)
* feat: upgrade sass and gulp sass so that it installs on a modern node.js
* fix: upgrade some packages and gulp config to 4.x series
* fix: add support for icons working as well
* Feat: get some tasks to work
* fix: port one more tasks even if it is still erroring
* wip: still broken config for webpack bundle
* fix: let the new tests run
* fix: issue with lint task
* fix: some more issues with loaders
* feat: get some tests passing atleast
* fix: the frontend tests pass now
* feat: generate new lock file
* feat: use gulp 4.x
* feat: make build use node16 as well
* feat: add .nvmrc for a consistent experience
* feat: Run workflows in concurrency groups (django-cms#7211)
* feat: Added concurrency config using unique workflow groups
* Remove whitespace to test cancellation
* Remove whitespace to test cancellation 2

Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
Co-authored-by: Simon Krull <simondotunix@gmail.com>

* Add toolbar fix for broken CMS in the release 3.10.x (django-cms#7233)

* Fix script typos (django-cms#7201)

* [refactor] Typos in release scripts

* This was correct.

Co-authored-by: Simon Krull <simondotunix@gmail.com>

* feat: Added concurrency option to github workflows (django-cms#7205)

* fix: Disable workflow concurrency to bring stability back to the CI (django-cms#7209)

* Upgrade Gulp and Nodejs (django-cms#7208)

* feat: upgrade sass and gulp sass so that it installs on a modern node.js

* fix: upgrade some packages and gulp config to 4.x series

* fix: add support for icons working as well

* Feat: get some tasks to work

* fix: port one more tasks even if it is still erroring

* wip: still broken config for webpack bundle

* fix: let the new tests run

* fix: issue with lint task

* fix: some more issues with loaders

* feat: get some tests passing atleast

* fix: the frontend tests pass now

* feat: generate new lock file

* feat: use gulp 4.x

* feat: make build use node16 as well

* feat: add .nvmrc for a consistent experience

* feat: Run workflows in concurrency groups (django-cms#7211)

* feat: Added concurrency config using unique workflow groups

* Remove whitespace to test cancellation

* Remove whitespace to test cancellation 2

Co-authored-by: Vinit Kumar <mail@vinitkumar.me>

* fix: Toolbar bug in 3.10 (django-cms#7232)

Co-authored-by: fsbraun <fsbraun@gmx.de>

Co-authored-by: Mark Walker <theshow@gmail.com>
Co-authored-by: Simon Krull <simondotunix@gmail.com>
Co-authored-by: fsbraun <fsbraun@gmx.de>

* fix: using .nvmrc to target teh right nvm version

* Release/3.10.x (django-cms#7260) Releasing 3.10.0RC2

* [3.10.0rc2 release process] Bumped version to 3.10.0rc2
* [3.10.0rc2 release process] compilemessages
* [3.10.0rc2 release process] compiling new static files
* [3.10.0rc2 release process] updating latest docs

* Update release script to make it compatible with BSD (macos) compatible

* Update release script to make it compatible with BSD (macos) compatible

* Release/3.10.x (django-cms#7275)

* Fixes django-cms#7288 by also catching AttributeError, when the current toolbar… (django-cms#7289)

* Fixes django-cms#7288 by also catching AttributeError, when the current toolbar object doesn't define get_draft_url()

* django-cms#7288: also catch AttributeError when `get_absolute_url()` isn't defined.

* Fix for django 2.2 in middleware [django-cms#7290] (django-cms#7293)

* Fix for django 2.2 in middleware [django-cms#7290]

* Address isort concern

* Update release script to make it compatible with BSD (macos) compatible

* Update release script to make it compatible with BSD (macos) compatible (django-cms#7294)

* Fix version number in bump commit

* Fix release script version commit. (django-cms#7295)

* Update release script to make it compatible with BSD (macos) compatible

* Fix version number in bump commit

* fix: typos in CHANGELOG.rst

* build: release 3.10.1rc1 (django-cms#7330)

* fix: Use http rather than https in toolbar sites menu (django-cms#7331)

* fix: Revert change to the toolbar sites menu to use ``http`` protocol (django-cms#7332)

* fix: Rename changelog title to fix release script

* fix: Changelog title for 3.10.1rc1 (django-cms#7345)

* fix: Request missing from test rendering (django-cms#7346)

* fix: Changelog titles for 3.10.x (django-cms#7347)

* build: Release 3.10.1 (django-cms#7348)

* Update CHANGELOG.rst

Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>

* Update CHANGELOG.rst

Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>

* Update CHANGELOG.rst

Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>

* Update CHANGELOG.rst

Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>

* Update docs/upgrade/3.10.1.rst

Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>

* ci: Flake8 fixes

* Addressing review comment [django-cms#7372]

Co-authored-by: Florian Delizy <fdelizy@logitech.com>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
Co-authored-by: Simon Krull <simondotunix@gmail.com>
Co-authored-by: fsbraun <fsbraun@gmx.de>
Co-authored-by: Marco Bonetti <mbonetti@gmail.com>
Co-authored-by: Conrad <grosserconrad@gmail.com>
Co-authored-by: Patrick Mazulo <pmazulo@gmail.com>
(cherry picked from commit 3b2dc10)
  • Loading branch information
marksweb committed Aug 1, 2022
1 parent 1fbf7b8 commit faf4bf1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion cms/admin/forms.py
Expand Up @@ -820,7 +820,8 @@ def __init__(self, *args, **kwargs):
def get_root_nodes(self):
# TODO: this needs to avoid using the pages accessor directly
nodes = TreeNode.get_root_nodes()
return nodes.exclude(cms_pages__is_page_type=not(self.page.is_page_type))
is_page_type = self.page.is_page_type
return nodes.exclude(cms_pages__is_page_type=not is_page_type)

def get_tree_options(self):
position = self.cleaned_data['position']
Expand Down
2 changes: 1 addition & 1 deletion cms/templatetags/cms_alias_tags.py
Expand Up @@ -16,7 +16,7 @@ def render_alias_plugin(context, instance):

# In edit mode, content is shown regardless of the source page publish status.
# In published mode, content is shown only if the source page is published.
if not(toolbar.edit_mode_active) and source and source.page:
if not toolbar.edit_mode_active and source and source.page:
# this is bad but showing unpublished content is worse
can_see_content = source.page.is_published(instance.language)
else:
Expand Down
18 changes: 9 additions & 9 deletions cms/tests/test_placeholder.py
Expand Up @@ -505,7 +505,7 @@ def test_plugins_language_fallback(self):
# configure non fallback
with self.settings(CMS_PLACEHOLDER_CONF=conf):
# Deutsch page should have no text
del(placeholder_de._plugins_cache)
del placeholder_de._plugins_cache
cache.clear()
content_de = _render_placeholder(placeholder_de, context_de)
# Deutsch page should inherit english content
Expand All @@ -516,12 +516,12 @@ def test_plugins_language_fallback(self):
request.user = self.get_superuser()
request.toolbar = CMSToolbar(request)
context_de2['request'] = request
del(placeholder_de._plugins_cache)
del placeholder_de._plugins_cache
cache.clear()
content_de2 = _render_placeholder(placeholder_de, context_de2)
self.assertFalse("en body" in content_de2)
# remove the cached plugins instances
del(placeholder_de._plugins_cache)
del placeholder_de._plugins_cache
cache.clear()
# Then we add a plugin to check for proper rendering
add_plugin(placeholder_de, 'TextPlugin', 'de', body='de body')
Expand Down Expand Up @@ -557,12 +557,12 @@ def test_nested_plugins_language_fallback(self):
request.user = self.get_superuser()
request.toolbar = CMSToolbar(request)
context_de2['request'] = request
del(placeholder_de._plugins_cache)
del placeholder_de._plugins_cache
cache.clear()
content_de2 = _render_placeholder(placeholder_de, context_de2)
self.assertFalse("en body" in content_de2)
# remove the cached plugins instances
del(placeholder_de._plugins_cache)
del placeholder_de._plugins_cache
cache.clear()
# Then we add a plugin to check for proper rendering
link_de = add_plugin(
Expand Down Expand Up @@ -594,13 +594,13 @@ def test_plugins_non_default_language_fallback(self):
# Deutsch page should have the text plugin
content_de = _render_placeholder(placeholder_en, context_de)
self.assertRegexpMatches(content_de, "^de body$")
del(placeholder_en._plugins_cache)
del placeholder_en._plugins_cache
cache.clear()
# English page should have no text
content_en = _render_placeholder(placeholder_en, context_en)
self.assertRegexpMatches(content_en, "^de body$")
self.assertEqual(len(content_en), 7)
del(placeholder_en._plugins_cache)
del placeholder_en._plugins_cache
cache.clear()
conf = {
'col_left': {
Expand All @@ -614,7 +614,7 @@ def test_plugins_non_default_language_fallback(self):
self.assertNotRegex(content_en, "^de body$")

# remove the cached plugins instances
del(placeholder_en._plugins_cache)
del placeholder_en._plugins_cache
cache.clear()
# Then we add a plugin to check for proper rendering
add_plugin(placeholder_en, 'TextPlugin', 'en', body='en body')
Expand Down Expand Up @@ -650,7 +650,7 @@ def test_plugins_discarded_with_language_fallback(self):
self.assertRegexpMatches(content_en, "^en body$")

# remove the cached plugins instances
del(placeholder_sidebar_en._plugins_cache)
del placeholder_sidebar_en._plugins_cache
cache.clear()

def test_plugins_prepopulate(self):
Expand Down
4 changes: 2 additions & 2 deletions cms/wizards/forms.py
Expand Up @@ -73,7 +73,7 @@ class Media:

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# set the entries here to get an up to date list of entries.
# set the entries here to get an up-to-date list of entries.
self.fields['entry'].choices = entry_choices(
user=self.user,
page=self.page,
Expand All @@ -82,7 +82,7 @@ def __init__(self, *args, **kwargs):
def get_wizard_entries(self):
for entry in self['entry']:
wizard = wizard_pool.get_entry(entry.choice_value)
yield(entry, wizard)
yield (entry, wizard)


class WizardStep2BaseForm(BaseFormMixin):
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Expand Up @@ -2,6 +2,10 @@
universal=1

[flake8]
exclude =
.env,
.venv,
**/migrations/**
ignore=E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E202,E203,E221,E225,E226,E231,E241,E251,E261,E262,E265,E271,E301,E302,E303,E501,E502,E701,E713,E714,E731,F401,F403
max-line-length = 119

Expand Down

0 comments on commit faf4bf1

Please sign in to comment.