Skip to content

Commit

Permalink
chore: apply wagtail update migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Muchogoc committed May 6, 2023
1 parent fd0c7d7 commit 68a0d1d
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 5 deletions.
2 changes: 2 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@
WAGTAILDOCS_DOCUMENT_FORM_BASE = "mycarehub.content.forms.CustomDocumentForm"
WAGTAIL_ENABLE_UPDATE_CHECK = "LTS"
WAGTAIL_ENABLE_WHATS_NEW_BANNER = True
WAGTAIL_MODERATION_ENABLED = False
WAGTAIL_WORKFLOW_ENABLED = False

# phone numbers
PHONENUMBER_DB_FORMAT = "E164"
Expand Down
2 changes: 1 addition & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from django.views.generic import RedirectView, TemplateView
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework.schemas import get_schema_view
from wagtail import urls as wagtail_urls
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.api.v2.router import WagtailAPIRouter
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.documents.api.v2.views import DocumentsAPIViewSet
from wagtail.images.api.v2.views import ImagesAPIViewSet
Expand Down
25 changes: 25 additions & 0 deletions mycarehub/clients/migrations/0004_alter_client_organisation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.1.9 on 2023-05-04 13:46

from django.db import migrations, models
import django.db.models.deletion
import mycarehub.utils.general_utils


class Migration(migrations.Migration):
dependencies = [
("common", "0007_alter_auditlog_organisation_and_more"),
("clients", "0003_client_enrollment_date"),
]

operations = [
migrations.AlterField(
model_name="client",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated by Django 4.1.9 on 2023-05-04 13:46

from django.db import migrations, models
import django.db.models.deletion
import mycarehub.utils.general_utils


class Migration(migrations.Migration):
dependencies = [
("common", "0006_auto_20230214_1434"),
]

operations = [
migrations.AlterField(
model_name="auditlog",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="facility",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="program",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="userfacilityallotment",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
]
4 changes: 2 additions & 2 deletions mycarehub/common/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def test_delete(self):
)
self.assertEqual(
response.status_code,
200,
302,
)


Expand Down Expand Up @@ -532,7 +532,7 @@ def test_delete(self):
)
self.assertEqual(
response.status_code,
200,
302,
)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# Generated by Django 4.1.9 on 2023-05-04 13:46

from django.db import migrations, models
import django.db.models.deletion
import mycarehub.utils.general_utils
import wagtail.images.models


class Migration(migrations.Migration):
dependencies = [
("taggit", "0005_auto_20220424_2025"),
("common", "0007_alter_auditlog_organisation_and_more"),
("content", "0007_alter_customimage_options"),
]

operations = [
migrations.AlterField(
model_name="author",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentbookmark",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentitem",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentitem",
name="program",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.program",
),
),
migrations.AlterField(
model_name="contentitemcategory",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentitemindexpage",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentitemindexpage",
name="program",
field=models.ForeignKey(
blank=True,
default=mycarehub.utils.general_utils.default_program,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.program",
),
),
migrations.AlterField(
model_name="contentitemtag",
name="tag",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="%(app_label)s_%(class)s_items",
to="taggit.tag",
),
),
migrations.AlterField(
model_name="contentlike",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentshare",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="contentview",
name="organisation",
field=models.ForeignKey(
default=mycarehub.utils.general_utils.default_organisation,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="customdocument",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="customimage",
name="file",
field=wagtail.images.models.WagtailImageField(
height_field="height",
upload_to=wagtail.images.models.get_upload_to,
verbose_name="file",
width_field="width",
),
),
migrations.AlterField(
model_name="customimage",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="custommedia",
name="organisation",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_related",
to="common.organisation",
),
),
migrations.AlterField(
model_name="customrendition",
name="file",
field=wagtail.images.models.WagtailImageField(
height_field="height",
upload_to=wagtail.images.models.get_rendition_upload_to,
width_field="width",
),
),
]
2 changes: 1 addition & 1 deletion mycarehub/content/views/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from wagtail.admin.auth import PermissionPolicyChecker
from wagtail.admin.forms.search import SearchForm
from wagtail.admin.models import popular_tags_for_model
from wagtail.core.models import Collection
from wagtail.models import Collection
from wagtailmedia.models import get_media_model
from wagtailmedia.permissions import permission_policy
from wagtailmedia.utils import paginate
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ djangorestframework-datatables~=0.7.0
djangorestframework~=3.13.0 # https://github.com/encode/django-rest-framework
django-rest-framework-braces~=0.3.4
drf-generators~=0.5.0
django~=4.1.8 # pyup: < 3.2 # https://www.djangoproject.com/
django~=3.2 # pyup: < 3.2 # https://www.djangoproject.com/
google-api-core~=2.11.0
google-api-python-client~=2.86.0
google-auth~=2.17.3
Expand Down

0 comments on commit 68a0d1d

Please sign in to comment.