Skip to content
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

Merged
merged 2 commits into from Aug 4, 2017

Conversation

franga2000
Copy link
Contributor

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.

@ellmetha ellmetha self-requested a review July 8, 2017 13:53
@ellmetha ellmetha self-assigned this Jul 8, 2017
Copy link
Owner

@ellmetha ellmetha left a 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 %}
Copy link
Owner

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. 😉

@franga2000
Copy link
Contributor Author

franga2000 commented Aug 3, 2017

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.
This doesn't apply to the admin page, but I have that ready too. Should I push it or do you prefer all fields remain on the admin page?

@ellmetha
Copy link
Owner

ellmetha commented Aug 4, 2017

@franga2000 I think we can leave the admin page as is. 😉

@ellmetha ellmetha merged commit 89077ff into ellmetha:master Aug 4, 2017
@ellmetha
Copy link
Owner

ellmetha commented Aug 4, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants