We should change the code of this module to use the new API classes and mixins added to openwisp-users, which were based on the code from this module so should be backward compatible, however, I found out a few issues:
I started this work on this branch: https://github.com/openwisp/openwisp-firmware-upgrader/tree/openwisp-users-api-mixins, it needs this other branch from openwisp-users to work: https://github.com/openwisp/openwisp-users/tree/improve-api-mixins, I had to give up because it's taking longer than expected and I hope @ManishShah120 you can help me to finish this.
PS: I think we should also change the definitions of the API views to use tuples instead of lists.
We should change the code of this module to use the new API classes and mixins added to openwisp-users, which were based on the code from this module so should be backward compatible, however, I found out a few issues:
organization_lookupfield, hence queries were failing to find the right organization field, I solved this in https://github.com/openwisp/openwisp-users/tree/improve-api-mixins, but tests are missing, we need at least one test in openwisp-users. Issue: [bug] API mixins don't take into account organization_lookup openwisp-users#255.assertNumQueriestests are failing! It looks like the number of queries increased between 2 and 3 queries for each endpoint, we should understand what the additional queries are doing, if they're really needed or not, if the extra queries are generated by mistake or not and what we can do to fix it. Issue: [bug] API mixins and classes seem to generate unneeded queries. openwisp-users#256I started this work on this branch: https://github.com/openwisp/openwisp-firmware-upgrader/tree/openwisp-users-api-mixins, it needs this other branch from openwisp-users to work: https://github.com/openwisp/openwisp-users/tree/improve-api-mixins, I had to give up because it's taking longer than expected and I hope @ManishShah120 you can help me to finish this.
PS: I think we should also change the definitions of the API views to use tuples instead of lists.