jazzband / django-avatar

A Django app for handling user avatars.
BSD 3-Clause "New" or "Revised" License
808 stars 303 forks source link

Migration to Django4.0 : TypeError: __init__() got an unexpected keyword argument 'providing_args' #203

Closed pulse-mind closed 2 years ago

pulse-mind commented 2 years ago

After modifying some source gettext_lazy, force_str...

I still have an error whe I run with Django4

avatar_updated = django.dispatch.Signal(providing_args=["user", "avatar"])
TypeError: __init__() got an unexpected keyword argument 'providing_args'
christianwgd commented 2 years ago

As you can see here, the "providing_args" parameter has never had a real functionality, so you can simply omit it or move the information to a comment, like so:

# Provides the arguments "user" and "avatar"
avatar_updated = django.dispatch.Signal()
pulse-mind commented 2 years ago

@christianwgd thank you for your answer. Actually I should had a look to others fork and pull request before trying to do it. But anyway I've done another fork for django4.0. I tried to convert travis to github workflow but I have an error:

Run make test
flake8 avatar --ignore=E124,E501,E127,E128,E722
coverage run --source=avatar `which django-admin.py` test tests
No file to run: 'test'
make: *** [Makefile:8: test] Error 1
Error: Process completed with exit code 2.

Do you have an idea of my problem ? I am not very confident with this process.

christianwgd commented 2 years ago

You need to create the proper environment: Create a virtual environment and install the depended python modules ("pip install -r requirements.txt"). Have a look at the Makefile, you also have to set the two export statements from the top.

"test" is the parameter for the Django manage.py script. You can substitute 'which django-admin.py' with "test_proj/manage.py".

With that i was able to run the tests.

johanneswilm commented 2 years ago

Fixed in version 6.0.0.