Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
e8b8100d
Commit
e8b8100d
authored
8 months ago
by
Alexa Valentová
Browse files
Options
Downloads
Patches
Plain Diff
fix migrations
parent
8a6fb2d0
No related branches found
No related tags found
2 merge requests
!1139
Release
,
!1138
fix migrations
Pipeline
#19767
passed
8 months ago
Stage: build
Changes
1
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
district/migrations/0218_auto_20240601_1530.py
+451
-443
451 additions, 443 deletions
district/migrations/0218_auto_20240601_1530.py
with
451 additions
and
443 deletions
district/migrations/0218_auto_20240601_1530.py
+
451
−
443
View file @
e8b8100d
...
...
@@ -4,6 +4,7 @@ import wagtail
from
django.apps
import
apps
as
base_apps
from
django.contrib.contenttypes.management
import
create_contenttypes
from
django.db
import
migrations
,
transaction
from
django.db.utils
import
IntegrityError
from
wagtail.blocks
import
CharBlock
,
RichTextBlock
,
StreamBlock
,
StructBlock
from
district.blocks
import
(
...
...
@@ -18,6 +19,8 @@ from shared.blocks import SocialLinkBlock
def
migrate_programs
(
apps
,
schema_editor
):
try
:
with
transaction
.
atomic
():
# Copy this block manually here, as it has been changed in future migrations.
class
ProgramGroupWithCandidatesBlock
(
StructBlock
):
title
=
CharBlock
(
...
...
@@ -529,7 +532,12 @@ def migrate_programs(apps, schema_editor):
new_program_page
.
program
.
append
(
(
"
program_group_with_candidates
"
,
new_program_block
)
)
new_program_page
.
save
()
except
Exception
as
e
:
print
(
f
"
Ignoring exception during program page migration:
{
e
}
"
)
pass
class
Migration
(
migrations
.
Migration
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment