Skip to content

Commit

Permalink
fix: migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Yu committed Nov 20, 2024
1 parent 64affce commit 34e9d01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
Unreleased
==========
* Dropped Support for Python 3.8
* Dropped Support for Django CMS < 4.1
* Introduced Django CMS 4.1 support.
* delete `VersionLock` as It's moved to Version.locked_by field.
* monkeypatch `ChangeListActionsMixin` in cms.admin.utils to support action list burger menu.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Django 4.2.8 on 2024-11-07 07:21

from django.db import migrations, transaction
from django.db import migrations


def forwards(apps, schema_editor):
Expand All @@ -11,10 +11,8 @@ def forwards(apps, schema_editor):
version_lock_qs = VersionLock.objects.using(db_alias).all()
versions = set(Version.objects.using(db_alias).filter(pk__in=version_lock_qs.values('version')))

with transaction.atomic():
for version in versions:
version.locked_by = version.versionlock.created_by

for version in versions:
version.locked_by = version.versionlock.created_by
Version.objects.using(db_alias).bulk_update(versions, ['locked_by'])


Expand Down

0 comments on commit 34e9d01

Please sign in to comment.