File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
contentcuration/contentcuration Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11# Generated manually to restore unique constraint
2- from django .db import migrations , models
2+ from django .db import migrations
3+ from django .db import models
34
45
56def remove_duplicate_submissions (apps , schema_editor ):
@@ -36,17 +37,18 @@ def reverse_remove_duplicates(apps, schema_editor):
3637class Migration (migrations .Migration ):
3738
3839 dependencies = [
39- ("contentcuration" , "0158_remove_unique_constraint_community_library_submission" ),
40+ (
41+ "contentcuration" ,
42+ "0158_remove_unique_constraint_community_library_submission" ,
43+ ),
4044 ]
4145
4246 # Run each operation in its own transaction to avoid
4347 # "pending trigger events" when altering the table after deletes
4448 atomic = False
4549
4650 operations = [
47- migrations .RunPython (
48- remove_duplicate_submissions , reverse_remove_duplicates
49- ),
51+ migrations .RunPython (remove_duplicate_submissions , reverse_remove_duplicates ),
5052 migrations .AddConstraint (
5153 model_name = "communitylibrarysubmission" ,
5254 constraint = models .UniqueConstraint (
@@ -55,4 +57,3 @@ class Migration(migrations.Migration):
5557 ),
5658 ),
5759 ]
58-
Original file line number Diff line number Diff line change @@ -800,7 +800,7 @@ def test_cannot_create_multiple_submissions_same_channel_same_version(
800800 status = community_library_submission .STATUS_PENDING ,
801801 )
802802 submission1 .countries .add (country )
803-
803+
804804 with transaction .atomic ():
805805 with self .assertRaises (IntegrityError ):
806806 submission2 = CommunityLibrarySubmission .objects .create (
You can’t perform that action at this time.
0 commit comments