Skip to content

Commit 942154f

Browse files
[pre-commit.ci] pre-commit autoupdate (#889)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.9](astral-sh/ruff-pre-commit@v0.11.8...v0.11.9) * Fix pre-commit issues * Fix pre-commit issues * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
1 parent d78ba7a commit 942154f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
args: [--target-version, "3.2"]
3939

4040
- repo: https://github.com/astral-sh/ruff-pre-commit
41-
rev: v0.11.8
41+
rev: v0.11.9
4242
hooks: # Format before linting
4343
# - id: ruff-format
4444
- id: ruff

django_celery_beat/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def crontab_schedule_celery_timezone():
6565
"""Return timezone string from Django settings ``CELERY_TIMEZONE`` variable.
6666
6767
If is not defined or is not a valid timezone, return ``"UTC"`` instead.
68-
""" # noqa: E501
68+
"""
6969
try:
7070
CELERY_TIMEZONE = getattr(
7171
settings, '%s_TIMEZONE' % current_app.namespace)

django_celery_beat/schedulers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ def _get_timezone_offset(self, timezone_name):
376376
# Get server timezone
377377
server_time = aware_now()
378378
# Use server_time.tzinfo directly if it is already a ZoneInfo instance
379-
server_tz = server_time.tzinfo if isinstance(server_time.tzinfo, ZoneInfo) else ZoneInfo(str(server_time.tzinfo))
379+
if isinstance(server_time.tzinfo, ZoneInfo):
380+
server_tz = server_time.tzinfo
381+
else:
382+
server_tz = ZoneInfo(str(server_time.tzinfo))
380383

381384
if isinstance(timezone_name, ZoneInfo):
382385
timezone_name = timezone_name.key

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DJANGO_SETTINGS_MODULE=t.proj.settings
99
ignore = N806, N802, N801, N803, W503, W504
1010
exclude =
1111
**/migrations/*.py
12+
max-line-length = 88
1213

1314
[pep257]
1415
ignore = D102,D104,D203,D105,D213

t/unit/test_schedulers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,6 @@ def mock_apply_async(*args, **kwargs):
14551455
assert self.captured_headers['periodic_task_name'] == self.m1.name
14561456

14571457

1458-
14591458
@pytest.mark.django_db
14601459
class test_timezone_offset_handling:
14611460
def setup_method(self):

0 commit comments

Comments
 (0)