django-avatar icon indicating copy to clipboard operation
django-avatar copied to clipboard

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

Open pulse-mind opened this issue 2 years ago • 3 comments

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'

pulse-mind avatar Jan 27 '22 18:01 pulse-mind

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()

christianwgd avatar Jan 29 '22 17:01 christianwgd

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

pulse-mind avatar Jan 29 '22 18:01 pulse-mind

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.

christianwgd avatar Jan 29 '22 18:01 christianwgd

Fixed in version 6.0.0.

johanneswilm avatar Aug 12 '22 05:08 johanneswilm