Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
fbdd10b0
Commit
fbdd10b0
authored
Nov 03, 2022
by
Craig Weber
Browse files
Remove usage of usage_count_enabled template tag since this tag was removed in Wagtail 4.1
parent
59b5cd63
Changes
3
Hide whitespace changes
Inline
Side-by-side
settings.py
View file @
fbdd10b0
...
@@ -15,6 +15,5 @@ INSTALLED_APPS += [
...
@@ -15,6 +15,5 @@ INSTALLED_APPS += [
]
]
WAGTAILVIDEOS_VIDEO_MODEL
=
'app.CustomVideoModel'
WAGTAILVIDEOS_VIDEO_MODEL
=
'app.CustomVideoModel'
WAGTAIL_USAGE_COUNT_ENABLED
=
True
DEFAULT_AUTO_FIELD
=
'django.db.models.AutoField'
DEFAULT_AUTO_FIELD
=
'django.db.models.AutoField'
tests/test_admin_views.py
View file @
fbdd10b0
...
@@ -221,8 +221,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
...
@@ -221,8 +221,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
# Ensure the form supports file uploads
# Ensure the form supports file uploads
self
.
assertContains
(
response
,
'enctype="multipart/form-data"'
)
self
.
assertContains
(
response
,
'enctype="multipart/form-data"'
)
@
override_settings
(
WAGTAIL_USAGE_COUNT_ENABLED
=
True
)
def
test_usage_count
(
self
):
def
test_with_usage_count
(
self
):
response
=
self
.
get
()
response
=
self
.
get
()
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTemplateUsed
(
response
,
'wagtailvideos/videos/edit.html'
)
self
.
assertTemplateUsed
(
response
,
'wagtailvideos/videos/edit.html'
)
...
...
wagtailvideos/templates/wagtailvideos/videos/edit.html
View file @
fbdd10b0
...
@@ -67,13 +67,10 @@
...
@@ -67,13 +67,10 @@
<dt>
{% trans "Duration" %}
</dt>
<dt>
{% trans "Duration" %}
</dt>
<dd>
{{ video.formatted_duration }}
</dd>
<dd>
{{ video.formatted_duration }}
</dd>
{% endif %}
{% endif %}
{% usage_count_enabled as uc_enabled %}
<dt>
{% trans "Usage" %}
</dt>
{% if uc_enabled %}
<dd>
<dt>
{% trans "Usage" %}
</dt>
<a
href=
"{{ video.usage_url }}"
>
{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}
</a>
<dd>
</dd>
<a
href=
"{{ video.usage_url }}"
>
{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}
</a>
</dd>
{% endif %}
</dl>
</dl>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment