ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

Fix error when user has custom avatar #928

Closed brunobastosg closed 1 year ago

brunobastosg commented 1 year ago

Error was introduced when django-avatar added support for rectangular avatars

Previously, method get_primary_avatar accepted only the size argument

Now, it has two args: width and height.

I took the simpler approach of assuming the avatars are always a square.

Ref: https://github.com/jazzband/django-avatar/commit/99a979b057e0a099eb1149eaac0956ce7a4b4fde

Closes #927

MarkusBauer commented 1 year ago

This bug hit our instance in production, I can confirm that this PR fixes it.

However, it is not backwards compatible - the new method signature appeared in django-avatar 7.0.0. I suggest we also change that in askbot_requirements.txt: django-avatar>=4.0 => django-avatar>=7.0

brunobastosg commented 1 year ago

This bug hit our instance in production, I can confirm that this PR fixes it.

However, it is not backwards compatible - the new method signature appeared in django-avatar 7.0.0. I suggest we also change that in askbot_requirements.txt: django-avatar>=4.0 => django-avatar>=7.0

Thanks, I forgot about that. Updated the PR with your suggestion.