Skip to content

Commit

Permalink
fix: fix PR errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshyu committed Mar 8, 2024
1 parent 5925f9d commit 36dfb06
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

services:
mysql:
image: mysql:5.7
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: djangocms_test
Expand Down
2 changes: 0 additions & 2 deletions cms/admin/pageadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,6 @@ def duplicate(self, request, object_id):
if obj is None:
raise self._get_404_exception(object_id)

request = copy.copy(request)

if request.method == 'GET':
# source is a field in the form
# because its value is in the url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_vary_cache_on(self, request, instance, placeholder):

def render(self, context, instance, placeholder):
request = context.get('request')
country_code = request.headers.get('country-code') or "any"
country_code = request.headers.get('Country-Code') or "any"
context['now'] = country_code
return context

Expand All @@ -101,7 +101,7 @@ class SekizaiPlugin(CMSPluginBase):
name = 'WITH SEki'
module = 'Test'
render_plugin = True
render_template = "plugins/sekizai.html"
render_template = "plugins/sekizai.html"s

def render(self, context, instance, placeholder):
context['now'] = datetime.now().microsecond
Expand Down
102 changes: 0 additions & 102 deletions cms/tests/test_docs.py

This file was deleted.

8 changes: 2 additions & 6 deletions cms/utils/compat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from platform import python_version
from django import get_version


try:
from packaging.version import Version
except ModuleNotFoundError:
from distutils.version import LooseVersion as Version
from django import get_version
from packaging.version import Version


DJANGO_VERSION = get_version()
Expand Down
2 changes: 2 additions & 0 deletions cms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def details(request, slug):
user_languages = get_public_languages(site_id=site.pk)

request_language = get_language_from_request(request, check_path=True)
if not request_language:
request_language = get_default_language_for_site(get_current_site().pk)

if not page.is_home and request_language not in user_languages:
# The homepage is treated differently because
Expand Down
4 changes: 4 additions & 0 deletions menus/menu_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
from django.utils.module_loading import autodiscover_modules
from django.utils.translation import get_language_from_request, gettext_lazy as _

from cms.utils import get_current_site
from cms.utils.conf import get_cms_setting
from cms.utils.i18n import get_default_language_for_site
from cms.utils.moderator import use_draft

from menus.base import Menu
Expand Down Expand Up @@ -102,6 +104,8 @@ def __init__(self, pool, request):
self.menus = pool.get_registered_menus(for_rendering=True)
self.request = request
self.request_language = get_language_from_request(request, check_path=True)
if not self.request_language:
self.request_language = get_default_language_for_site(get_current_site().pk)
self.site = Site.objects.get_current(request)
self.draft_mode_active = use_draft(request)

Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@


REQUIREMENTS = [
'Django>=3.2',
'Django>=3.2, <5',
'django-classy-tags>=0.7.2',
'django-formtools>=2.1',
'django-treebeard>=4.3',
'django-sekizai>=0.7',
'djangocms-admin-style>=1.2',
'packaging'
]


Expand All @@ -24,14 +25,15 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development',
Expand Down
1 change: 0 additions & 1 deletion test_requirements/django-4.2.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-r requirements_base.txt
Django>=4.2,<5.0
django-formtools==2.4.1

0 comments on commit 36dfb06

Please sign in to comment.