Skip to content

Commit e8a79f1

Browse files
committed
fix: apply fixes from weblate 5.15.1
- The settings were overridden by automatic detection. - Locking was not working properly for linked components.
1 parent 84368ee commit e8a79f1

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN \
4848

4949
# Apply hotfixes on Weblate
5050
RUN find /app/src -name '*.patch' -print0 | sort -z | \
51-
xargs -n1 -0 -r patch -p0 -d "/app/venv/lib/python${PYVERSION}/site-packages/" -i
51+
xargs -n1 -0 -r patch -p1 -d "/app/venv/lib/python${PYVERSION}/site-packages/" -i
5252

5353

5454
FROM weblate/base:2025.51.0@sha256:a4cb92d3c5759da2899fae7caaa8910ab6207b1f0da77ada5fb82ec68652220b AS final
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 7e11e1e5439effc4af6e3a06314614a68ed3fb7f Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <[email protected]>
3+
Date: Tue, 16 Dec 2025 16:20:43 +0100
4+
Subject: [PATCH 1/1] fix(component): do not try to reacquire not held lock
5+
6+
The linked component lock does not have to be held in some contexts.
7+
8+
Fixes WEBLATE-38AZ
9+
---
10+
weblate/trans/models/component.py | 2 +-
11+
weblate/utils/lock.py | 1 +
12+
2 files changed, 2 insertions(+), 1 deletion(-)
13+
14+
diff --git a/weblate/trans/models/component.py b/weblate/trans/models/component.py
15+
index 19ea646d7d..69c4b29fd5 100644
16+
--- a/weblate/trans/models/component.py
17+
+++ b/weblate/trans/models/component.py
18+
@@ -2759,7 +2759,7 @@ class Component(
19+
def refresh_lock(self) -> None:
20+
"""Refresh the lock to avoid expiry in long operations."""
21+
self.lock.reacquire()
22+
- if self.linked_component:
23+
+ if self.linked_component and self.linked_component.lock.is_locked:
24+
self.linked_component.lock.reacquire()
25+
26+
def _create_translations( # noqa: C901,PLR0915
27+
diff --git a/weblate/utils/lock.py b/weblate/utils/lock.py
28+
index 4ebacdab53..f4779647d6 100644
29+
--- a/weblate/utils/lock.py
30+
+++ b/weblate/utils/lock.py
31+
@@ -111,6 +111,7 @@ class WeblateLock:
32+
33+
This is needed with Redis as the lock is expiring to avoid it stay infinitely.
34+
"""
35+
+ self.add_breadcrumb("reacquire")
36+
if self._using_redis:
37+
self._redis_lock.reacquire()
38+
39+
--
40+
2.47.3
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 0383aae884203b77a218a57a34cb90bbb6196119 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <[email protected]>
3+
Date: Tue, 16 Dec 2025 16:00:59 +0100
4+
Subject: [PATCH 1/1] fix(docker): make SSL autodetection work only when not
5+
configured
6+
7+
Fixes WEBLATE-38AQ
8+
---
9+
docs/changes.rst | 4 ++++
10+
weblate/settings_docker.py | 14 +++++++++-----
11+
2 files changed, 13 insertions(+), 5 deletions(-)
12+
13+
diff --git a/weblate/settings_docker.py b/weblate/settings_docker.py
14+
index 2d3e7f8e1c..2d00d9bf40 100644
15+
--- a/weblate/settings_docker.py
16+
+++ b/weblate/settings_docker.py
17+
@@ -1337,11 +1337,15 @@ elif EMAIL_USE_TLS:
18+
DEFAULT_EMAIL_PORT = 465
19+
EMAIL_PORT = get_env_int("WEBLATE_EMAIL_PORT", DEFAULT_EMAIL_PORT)
20+
21+
-# Detect SSL/TLS setup
22+
-if not EMAIL_USE_TLS and EMAIL_PORT in {25, 587}:
23+
- EMAIL_USE_TLS = True
24+
-elif not EMAIL_USE_SSL and EMAIL_PORT == 465:
25+
- EMAIL_USE_SSL = True
26+
+# Detect SSL/TLS setup if not explicitly stated
27+
+if (
28+
+ "WEBLATE_EMAIL_USE_SSL" not in os.environ
29+
+ and "WEBLATE_EMAIL_USE_TLS" not in os.environ
30+
+):
31+
+ if not EMAIL_USE_TLS and EMAIL_PORT in {25, 587}:
32+
+ EMAIL_USE_TLS = True
33+
+ elif not EMAIL_USE_SSL and EMAIL_PORT == 465:
34+
+ EMAIL_USE_SSL = True
35+
36+
EMAIL_BACKEND = get_env_str(
37+
"WEBLATE_EMAIL_BACKEND",
38+
--
39+
2.47.3

0 commit comments

Comments
 (0)