Skip to content

Commit

Permalink
Privacy Levels: migrate protected projects to private
Browse files Browse the repository at this point in the history
All protected projects should be private for .org and .com.
Next step is to send an email to all .org users that have private
projects.
  • Loading branch information
stsewd committed Oct 28, 2020
1 parent b3c54a1 commit a579991
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions readthedocs/projects/migrations/0066_migrate_protected_projects.py
@@ -0,0 +1,24 @@
# Generated by Django 2.2.16 on 2020-10-27 15:00

from django.db import migrations


def forwards_func(apps, schema_editor):
"""Migrate all protected projects to private."""
Project = apps.get_model('projects', 'Project')
(
Project.objects
.filter(privacy_level='protected')
.update(privacy_level='private')
)


class Migration(migrations.Migration):

dependencies = [
('projects', '0065_add_feature_future_default_true'),
]

operations = [
migrations.RunPython(forwards_func),
]

0 comments on commit a579991

Please sign in to comment.