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

In Admin: build_attrs() got an unexpected keyword argument #107

Closed
astarrh opened this issue Apr 25, 2017 · 7 comments
Closed

In Admin: build_attrs() got an unexpected keyword argument #107

astarrh opened this issue Apr 25, 2017 · 7 comments

Comments

@astarrh
Copy link

astarrh commented Apr 25, 2017

Python 3.6.1 - Django 1.11 - Windows 10 - Package version: 1.3.3

I'm not really sure what's going on, but whenever I try to open an object in my admin panel, I get the following error:

TypeError at /admin/Events/event/17/change/ build_attrs() got an unexpected keyword argument 'name'

Exception is located at:

C:\Users\Adam\Envs\otherlane_2\lib\site-packages\sortedm2m\forms.py in build_attrs, line 35

This is the start of the function. This last line seems to be the issue:

    def render(self, name, value, attrs=None, choices=()):
        if value is None: value = []
        has_id = attrs and 'id' in attrs
        final_attrs = self.build_attrs(attrs, name=name)

It seems CKEditor had a similar problem and had to undergo a revision:
https://github.com/django-ckeditor/django-ckeditor/pull/364/files

@PaulGregor
Copy link

Same here. Django 1.11 causes this.

@ljholish
Copy link

ljholish commented May 6, 2017

Ran into this same TypeError, too. Django 1.11, python 3.5, sortedm2m 1.3.3
Error during template rendering
/lib/python3.5/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19

Traceback (partial):

lib/python3.5/site-packages/sortedm2m/forms.py in build_attrs
35. build_attrs(attrs, **kwargs)

@PaulGregor
Copy link

I made a pull request that fixes this problem.

@jharrell
Copy link

I believe this was also addressed in #104 by @fdintino

Unfortunately we haven't heard back from @gregmuellegger about the issue or PR in question

@fdintino
Copy link
Member

This is addressed by #104. I emailed @gregmuellegger a week ago and he responded that he's aware of the pull request and that, though he's busy, he'll look into it when he can.

@gregmuellegger
Copy link
Collaborator

Hey, thank you all for the reports, comments and contributions! I just merged #104 and released 1.4.0 including a fix for this. Can you please test and confirm that this also fixes this issue?

@astarrh
Copy link
Author

astarrh commented Jun 12, 2017

Confirmed that this resolves the issue for me. Thank you kindly for your excellent work!

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

No branches or pull requests

6 participants