File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change
1
+ from django .core .management import BaseCommand
2
+ from wagtail .core .models import Page
3
+ from wagtail_localize .models import TranslationSource
4
+
5
+
6
+ class Command (BaseCommand ):
7
+ def handle (self , * args , ** options ):
8
+ for page in Page .objects .all ():
9
+ translation_sources = TranslationSource .objects .filter (
10
+ object_id = page .translation_key ,
11
+ specific_content_type = page .content_type_id ,
12
+ translations__target_locale = page .locale ,
13
+ )
14
+
15
+ if translation_sources .count () > 1 :
16
+ self .stdout .write (f"Multiple translation sources found for page: { page .id } , title: { page .title } " )
17
+ for translation_source in translation_sources :
18
+ self .stdout .write (f" - Translation source: { translation_source .id } , locale: { translation_source .locale } " )
Original file line number Diff line number Diff line change 566
566
567
567
# Width size options are 360, 750
568
568
IMAGE_SIZE_PRESET = int (os .getenv ('IMAGE_SIZE_PRESET' , '' ) or '360' )
569
+
570
+ # Default primary key field type introduced in Django 3.2 or later versions
571
+ # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
572
+
573
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ django-debug-toolbar==3.2.1
6
6
django-extensions == 3.1.*
7
7
django-sass-processor == 1.0.*
8
8
django-translation-manager ~= 1.3.0
9
- django == 3.1 .*
9
+ django == 3.2 .*
10
10
elasticsearch ~= 7.16
11
11
libsass == 0.21.*
12
12
lxml == 4.8.*
13
13
psycopg2 == 2.8.*
14
14
redis ~= 3.0
15
15
tqdm == 4.62.*
16
- wagtail-localize == 1.2.1
16
+ wagtail-localize == 1.3.3
17
17
wagtail-markdown == 0.7.0
18
18
Markdown == 3.3.7
19
19
wagtail == 2.15.*
You can’t perform that action at this time.
0 commit comments