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

Bug when updating Django-ajax-selects from 1.4.3 to version 1.5.2 #104

Open
miguelcleon opened this issue Feb 3, 2017 · 8 comments
Open

Comments

@miguelcleon
Copy link
Member

@lsetiawan I found one of potentially two problems from the Conda packaging @ocefpaf has been working on. The problem appears to be related to the read only group. The bug only appears after upgrading Django-ajax-selects to version 1.5.2 (the servers are using 1.4.3).

NoReverseMatch at /admin/odm2admin/variables/1/change/
Reverse for 'odm2admin_cvvariabletype_add' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

\odm2admin\readonlyadmin.py in get_form
13.        form = super(ReadOnlyAdmin, self).get_form(request, obj, **kwargs)

Can you try to reproduce this?

@miguelcleon miguelcleon changed the title Bug when upgrading Django-ajax-selects from 1.4.3 to version 1.5.2 Bug when updating Django-ajax-selects from 1.4.3 to version 1.5.2 Feb 3, 2017
@lsetiawan
Copy link
Member

@miguelcleon This was the similar problem that I encountered on this issue https://github.com/miguelcleon/ODM2-Admin/issues/98 When i comment out the parts of the code that creates the ajax fields it works fine. I will try to look into this further. Maybe Djano-ajax-selects have really updated their syntax. Thanks.

@ocefpaf
Copy link
Member

ocefpaf commented Feb 3, 2017

@miguelcleon I agree that fixing it is the best course of action, but let me know if you want me to add an old version (1.4.3) to the channel while we figure this out.

@miguelcleon
Copy link
Member Author

@lsetiawan yes, #98 does appear to be the same problem, just on a different ajax select field.

@miguelcleon
Copy link
Member Author

@ocefpaf yes it would be good to have the old version for the moment. Then I can check if the other problem with the inline forms is still occuring. It doesn't seem to happen on my local development machine.

@miguelcleon
Copy link
Member Author

miguelcleon commented Feb 3, 2017

@lsetiawan so for some reason not all of the ajax select fields have the problem, for instance I can load the results change form fine (/odm2admin/results/16658/change/ for example with the LCZO database). This uses the AJAX_LOOKUP_CHANNELS featureaction_lookup I thought maybe using AutoCompleteSelectField instead of make_ajax_field was the difference but I tried changing it in one of the other forms and I still got the error.

@lsetiawan
Copy link
Member

@miguelcleon I commented out autoselect_fields_check_can_add(form, self.model, request.user) in readonlyadmin.py and this seemed to fix the problem. Though I'm not quite sure of the consequences. Thanks.

@miguelcleon
Copy link
Member Author

@lsetiawan I can confirm that commenting out that line prevented the error. It might not be a problem if a readonly user still can't make any changes.

@ocefpaf
Copy link
Member

ocefpaf commented Feb 3, 2017

@ocefpaf yes it would be good to have the old version for the moment.

See #106

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

3 participants