Skip to content

Commit

Permalink
Fix Wagtail 4.2 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LLoyderino committed Feb 23, 2023
1 parent f1be047 commit fc66ef6
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
author_email="[email protected]",
url="https://github.com/neon-jungle/wagtailvideos",
install_requires=[
"wagtail>=4.0",
"wagtail>=4.2",
"Django>=3.2",
"django-enumchoicefield>=1.1.0",
"bcp47==0.0.4",
Expand Down
8 changes: 4 additions & 4 deletions tests/app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import enumchoicefield.fields
import modelcluster.fields
import taggit.managers
import wagtail.core.fields
import wagtail.core.models
import wagtail.fields
import wagtail.models
import wagtail.search.index
import wagtailvideos.blocks
import wagtailvideos.models
Expand Down Expand Up @@ -44,7 +44,7 @@ class Migration(migrations.Migration):
('duration', models.DurationField(blank=True, null=True)),
('file_size', models.PositiveIntegerField(editable=False, null=True)),
('attribution', models.TextField(blank=True)),
('collection', models.ForeignKey(default=wagtail.core.models.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Collection', verbose_name='collection')),
('collection', models.ForeignKey(default=wagtail.models.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Collection', verbose_name='collection')),
('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem', to='taggit.Tag', verbose_name='tags')),
('uploaded_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')),
],
Expand All @@ -57,7 +57,7 @@ class Migration(migrations.Migration):
name='TestPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('video_streamfield', wagtail.core.fields.StreamField([('video', wagtailvideos.blocks.VideoChooserBlock())], blank=True)),
('video_streamfield', wagtail.fields.StreamField([('video', wagtailvideos.blocks.VideoChooserBlock())], blank=True)),
('video_field', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='app.CustomVideoModel')),
],
options={
Expand Down
6 changes: 3 additions & 3 deletions tests/app/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from wagtail.models import Page

from wagtailvideos.blocks import VideoChooserBlock
from wagtailvideos.edit_handlers import VideoChooserPanel
Expand Down
2 changes: 1 addition & 1 deletion tests/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'taggit',
'modelcluster',

'wagtail.core',
'wagtail',
'wagtail.admin',
'wagtail.users',
'wagtail.sites',
Expand Down
6 changes: 3 additions & 3 deletions tests/app/test_block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from wagtail.core.models import Page, Site
from wagtail.tests.utils import WagtailPageTests
from wagtail.tests.utils.form_data import nested_form_data, streamfield
from wagtail.models import Page, Site
from wagtail.test.utils import WagtailPageTests
from wagtail.test.utils.form_data import nested_form_data, streamfield

from tests.app.models import TestPage
from tests.utils import create_test_video_file
Expand Down
2 changes: 1 addition & 1 deletion tests/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.urls import path, re_path
from django.views.static import serve
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail import urls as wagtail_urls

urlpatterns = [
path('admin/', include(wagtailadmin_urls)),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_admin_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from django.test import TestCase, override_settings
from django.urls import reverse
from mock import patch
from wagtail.core.models import Collection, GroupCollectionPermission
from wagtail.tests.utils import WagtailTestUtils
from wagtail.models import Collection, GroupCollectionPermission
from wagtail.test.utils import WagtailTestUtils

from tests.utils import create_test_video_file
from wagtailvideos.models import Video
Expand Down
2 changes: 1 addition & 1 deletion tests/test_custom_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from wagtail.tests.utils import WagtailTestUtils
from wagtail.test.utils import WagtailTestUtils

from tests.app.models import CustomVideoModel
from wagtailvideos import get_video_model, get_video_model_string
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/blocks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.utils.functional import cached_property
from wagtail.core.blocks import ChooserBlock
from wagtail.blocks import ChooserBlock


class VideoChooserBlock(ChooserBlock):
Expand Down
4 changes: 2 additions & 2 deletions wagtailvideos/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import django.db.models.deletion
import taggit.managers
import wagtail.core.models
import wagtail.models
import wagtail.search.index
from django.conf import settings
from django.db import migrations, models
Expand All @@ -31,7 +31,7 @@ class Migration(migrations.Migration):
('file', models.ImageField(height_field='height', upload_to=wagtailvideos.models.get_upload_to, verbose_name='file', width_field='width')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
('file_size', models.PositiveIntegerField(editable=False, null=True)),
('collection', models.ForeignKey(default=wagtail.core.models.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Collection', verbose_name='collection')),
('collection', models.ForeignKey(default=wagtail.models.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Collection', verbose_name='collection')),
('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem', to='taggit.Tag', verbose_name='tags')),
('uploaded_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')),
],
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from taggit.managers import TaggableManager
from wagtail.core.models import CollectionMember, Orderable
from wagtail.models import CollectionMember, Orderable
from wagtail.search import index
from wagtail.search.queryset import SearchableQuerySetMixin

Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/permissions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wagtail.core.permission_policies.collections import (
from wagtail.permission_policies.collections import (
CollectionOwnershipPermissionPolicy)

from wagtailvideos import get_video_model
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/views/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from wagtail.admin import messages
from wagtail.admin.forms.search import SearchForm
from wagtail.contrib.modeladmin.helpers import AdminURLHelper
from wagtail.core.models import Collection
from wagtail.models import Collection
from wagtail.search.backends import get_search_backends

from wagtailvideos import ffmpeg, get_video_model, is_modeladmin_installed
Expand Down
4 changes: 2 additions & 2 deletions wagtailvideos/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from django.urls import path, reverse
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from wagtail.admin.edit_handlers import InlinePanel
from wagtail.admin.panels import InlinePanel
from wagtail.admin.menu import Menu, MenuItem, SubmenuMenuItem
from wagtail.admin.search import SearchArea
from wagtail.admin.site_summary import SummaryItem
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail.core import hooks
from wagtail import hooks

from wagtailvideos import get_video_model, is_modeladmin_installed, urls
from wagtailvideos.edit_handlers import VideoChooserPanel
Expand Down

0 comments on commit fc66ef6

Please sign in to comment.