-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing ocladmin orgs membership data reset on api deploy
- Loading branch information
1 parent
bb9802c
commit 0490b43
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 4.0.6 on 2022-09-02 05:17 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def add_org_creator_as_member(apps, schema_editor): | ||
Organization = apps.get_model('orgs', 'Organization') | ||
for org in Organization.objects.all(): | ||
org.members.add(org.created_by, org.updated_by) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('orgs', '0017_alter_organization_created_by_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(add_org_creator_as_member) | ||
] |