New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move avatar rendering to a partial template #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for this late review. 😉 There is something to fix related to the way to disable the avatar
form field. But otherwise this is really good work and I'll gladly merge it once the behaviour related to the avatar
form field is updated! Thanks!
@@ -12,7 +12,7 @@ | |||
<h3 class="panel-title">{% trans "Edit forum profile" %}</h3> | |||
</div> | |||
<div class="panel-body"> | |||
<form method="post" action="." class="form" enctype="multipart/form-data" novalidate>{% csrf_token %} | |||
<form method="post" action="." class="form" enctype="multipart/form-data" novalidate>{% csrf_token %}{% if AVATARS_ENABLED %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right way to disable the avatar field in the form. Technically a user could still upload an avatar since the Django form will still accept it. IMHO a better solution would be to manually remove the avatar
form field in the FormProfileForm.__init__
method (here: https://github.com/ellmetha/django-machina/blob/master/machina/apps/forum_member/forms.py#L13) if the MACHINA_PROFILE_AVATARS_ENABLED
setting is set to False
. 😉
Sorry for the late reply, I was on vacation 😎. I made it so the field is completely removed from the form when avatars are disabled. |
@franga2000 I think we can leave the admin page as is. 😉 |
Thanks! |
A super easy, backwards-compatible way of allowing the use of external avatar apps.
Similar to what I proposed in #67, but implemented with a partial template rather than a tag.