diff --git a/config/settings/base.py b/config/settings/base.py index 7062dd1..523dd13 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -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" diff --git a/config/urls.py b/config/urls.py index c082e54..a94033a 100644 --- a/config/urls.py +++ b/config/urls.py @@ -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 diff --git a/mycarehub/clients/migrations/0004_alter_client_organisation.py b/mycarehub/clients/migrations/0004_alter_client_organisation.py new file mode 100644 index 0000000..5fe2fea --- /dev/null +++ b/mycarehub/clients/migrations/0004_alter_client_organisation.py @@ -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", + ), + ), + ] diff --git a/mycarehub/common/migrations/0007_alter_auditlog_organisation_and_more.py b/mycarehub/common/migrations/0007_alter_auditlog_organisation_and_more.py new file mode 100644 index 0000000..84f0326 --- /dev/null +++ b/mycarehub/common/migrations/0007_alter_auditlog_organisation_and_more.py @@ -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", + ), + ), + ] diff --git a/mycarehub/common/tests/test_api.py b/mycarehub/common/tests/test_api.py index 09f0666..5169c38 100644 --- a/mycarehub/common/tests/test_api.py +++ b/mycarehub/common/tests/test_api.py @@ -365,7 +365,7 @@ def test_delete(self): ) self.assertEqual( response.status_code, - 200, + 302, ) @@ -532,7 +532,7 @@ def test_delete(self): ) self.assertEqual( response.status_code, - 200, + 302, ) diff --git a/mycarehub/content/migrations/0008_alter_author_organisation_and_more.py b/mycarehub/content/migrations/0008_alter_author_organisation_and_more.py new file mode 100644 index 0000000..df0acc1 --- /dev/null +++ b/mycarehub/content/migrations/0008_alter_author_organisation_and_more.py @@ -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", + ), + ), + ] diff --git a/mycarehub/content/views/media.py b/mycarehub/content/views/media.py index bbca47d..a9dfb6c 100644 --- a/mycarehub/content/views/media.py +++ b/mycarehub/content/views/media.py @@ -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 diff --git a/requirements/base.txt b/requirements/base.txt index 6ec2a83..ed86f2c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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