mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-03-16 22:10:28 +00:00
Eliminate dependency on default User model from style guide
Fixes #5442. Building a User object for david@torchbox.com may cause problems if a custom user model is in use, and is redundant anyhow because there's no longer a registered gravatar for that email - we should just hard-code the default blank avatar instead.
This commit is contained in:
parent
000c4990b4
commit
44a1e6f9f8
4 changed files with 5 additions and 7 deletions
|
|
@ -39,6 +39,7 @@ Changelog
|
|||
* Fix: Language chosen in user preferences no longer persists on subsequent requests (Bojan Mihelac)
|
||||
* Fix: Prevent new block IDs from being assigned on repeated calls to `StreamBlock.get_prep_value` (Colin Klein)
|
||||
* Fix: Prevent broken images in notification emails when static files are hosted on a remote domain (Eduard Luca)
|
||||
* Fix: Replace styleguide example avatar with default image to avoid issues when custom user model is used (Matt Westcott)
|
||||
|
||||
|
||||
2.6.2 (19.09.2019)
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ Bug fixes
|
|||
* Language chosen in user preferences no longer persists on subsequent requests (Bojan Mihelac)
|
||||
* Prevent new block IDs from being assigned on repeated calls to ``StreamBlock.get_prep_value`` (Colin Klein)
|
||||
* Prevent broken images in notification emails when static files are hosted on a remote domain (Eduard Luca)
|
||||
* Replace styleguide example avatar with default image to avoid issues when custom user model is used (Matt Westcott)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
|
|
|||
|
|
@ -742,9 +742,9 @@
|
|||
<h2>Misc formatters</h2>
|
||||
<h3>Avatar icons</h3>
|
||||
|
||||
<p><span class="avatar"><img src="{% avatar_url user size=50 %}" alt="" /></span> Avatar normal</p>
|
||||
<p><span class="avatar square"><img src="{% avatar_url user size=50 %}" alt="" /></span> Avatar square</p>
|
||||
<p><span class="avatar small"><img src="{% avatar_url user size=25 %}" alt="" /></span> Avatar small</p>
|
||||
<p><span class="avatar"><img src="{% static 'wagtailadmin/images/default-user-avatar.png' %}" alt="" /></span> Avatar normal</p>
|
||||
<p><span class="avatar square"><img src="{% static 'wagtailadmin/images/default-user-avatar.png' %}" alt="" /></span> Avatar square</p>
|
||||
<p><span class="avatar small"><img src="{% static 'wagtailadmin/images/default-user-avatar.png' %}" alt="" /></span> Avatar small</p>
|
||||
|
||||
<h3>Status tags</h3>
|
||||
<div class="status-tag primary">Primary tag</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.paginator import Paginator
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import ugettext as _
|
||||
|
|
@ -72,11 +71,8 @@ def index(request):
|
|||
paginator = Paginator(list(range(100)), 10)
|
||||
page = paginator.page(2)
|
||||
|
||||
user = User(email='david@torchbox.com')
|
||||
|
||||
return render(request, 'wagtailstyleguide/base.html', {
|
||||
'search_form': form,
|
||||
'example_form': example_form,
|
||||
'example_page': page,
|
||||
'user': user,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue