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

Fix settings with Django 1.11 #682

Merged
merged 1 commit into from Sep 6, 2017

Conversation

floemker
Copy link
Contributor

@floemker floemker commented Sep 3, 2017

The notifications plugin uses a ModelChoiceField in it's settings. A
ModelChoiceField needs as first argument a QuerySet or initially None,
not a Model. Since Django 1.11 the provided queryset is already used in
the __init__() function, resulting in an AttributeError when the wrong
type is used here.

This fixed issue #676.

A ModelChoiceField needs as first argument a QuerySet or initially None,
not a Model. Since Django 1.11 the queryset is already used in the
__init__() function, resulting in an AttributeError when the wrong
type is used here.
@benjaoming benjaoming merged commit e82e596 into django-wiki:master Sep 6, 2017
@benjaoming
Copy link
Member

Thanks for fixing this, will get a patch release out ASAP and report back....

@benjaoming
Copy link
Member

Also wondering: Why didn't this show up in tests....

@tomaszgy
Copy link

tomaszgy commented Sep 6, 2017

Hey, guys, thanks for a quick patch! Unfortunately, now when clicking on Settings button we're getting another error:

TypeError at /wiki/_settings/
build_attrs() got an unexpected keyword argument 'name'

It seems like it's due to a change in build_attrs() method arguments in Django after 1.10.4:
https://github.com/django/django/blob/master/django/forms/widgets.py#L243

No **kwargs anymore.

@benjaoming
Copy link
Member

True that... and I think we've fixed this before... and once again, I wonder why tests aren't catching this, they should, let's figure it out...

@floemker
Copy link
Contributor Author

floemker commented Sep 6, 2017

Could you post a complete trace? For me opening the settings works
with Django 1.11.4. And I see only calls to build_attrs_compat()
in the code.

@benjaoming
Copy link
Member

@floemker - it could be related to enabled plugins? Do you have notifications? (sorry, am just in the middle of writing release notes and releasing 0.3b3 on a limited time budget)

@floemker
Copy link
Contributor Author

floemker commented Sep 6, 2017

Yes, notifications are enabled. It's with the nearly default test project.
My only local change is an additional URL pattern for the Django debug toolbar.

@benjaoming
Copy link
Member

@tomaszgy - we'd need the traceback then over in #687 to make progress - thanks for reporting

@tomaszgy
Copy link

tomaszgy commented Sep 6, 2017

@benjaoming, just realized that error occured with wiki 0.2.4 and Django 1.11.3 which is not a supported combination. Very sorry for the confusion!

@benjaoming
Copy link
Member

Alright cool, thanks for letting us know!

@floemker floemker deleted the notificationSettings branch September 9, 2017 03:47
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

3 participants