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
80cecf6b
Commit
80cecf6b
authored
9 months ago
by
Tomi Valentová
Browse files
Options
Downloads
Patches
Plain Diff
fix migrations
parent
8742fd5a
No related branches found
Branches containing commit
No related tags found
2 merge requests
!1047
Uniweb redesign
,
!1046
Fix migrations
Pipeline
#19013
passed
9 months ago
Stage: build
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
district/migrations/0196_auto_20240509_1227.py
+2
-1
2 additions, 1 deletion
district/migrations/0196_auto_20240509_1227.py
uniweb/migrations/0072_auto_20240626_1235.py
+9
-4
9 additions, 4 deletions
uniweb/migrations/0072_auto_20240626_1235.py
with
11 additions
and
5 deletions
district/migrations/0196_auto_20240509_1227.py
+
2
−
1
View file @
80cecf6b
...
...
@@ -30,7 +30,8 @@ class Migration(migrations.Migration):
]
operations
=
[
migrations
.
RunPython
(
add_calendar_block
),
# FIXME
# migrations.RunPython(add_calendar_block),
migrations
.
RemoveField
(
model_name
=
"
districthomepage
"
,
name
=
"
show_calendar_on_hp
"
,
...
...
This diff is collapsed.
Click to expand it.
uniweb/migrations/0072_auto_20240626_1235.py
+
9
−
4
View file @
80cecf6b
from
django.db
import
migrations
from
django.db
import
migrations
,
transaction
def
migrate_button_blocks
(
apps
,
schema_editor
):
...
...
@@ -65,9 +65,14 @@ def migrate_button_blocks(apps, schema_editor):
for
field
in
fields
:
new_values
=
[]
for
block
in
getattr
(
instance
,
field
):
new_block
=
process_block
(
block
)
new_values
.
append
(
new_block
)
try
:
with
transaction
.
atomic
():
for
block
in
getattr
(
instance
,
field
):
new_block
=
process_block
(
block
)
new_values
.
append
(
new_block
)
except
Exception
:
# Skip instances that, for whichever reason, generate errors.
continue
# Clean the old field (e.g., instance.content = [])
setattr
(
instance
,
field
,
[])
...
...
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