Found a bug of sorts, likely due to my workflow.


It happens when changing the owner/organization of a device from default to 
another ​organization. The interface changes the selection of templates to 
the default enabled for the new organization, which is the desired 
operation. 


The problem however, when trying to save, it complains about those 
templates not belonging to the organization. If I deselect all templates, 
save, then manually select them again, it saves without issue.


<https://lh3.googleusercontent.com/-FEg0ZWOxtnE/WNWEMyTQKtI/AAAAAAAAB7U/psdhXHwTBus_Vyb-Oc1HAZFjL2Wor0UwACLcB/s1600/Screen%2BShot%2B2017-03-24%2Bat%2B4.11.12%2BPM.png>



My guess is that the logic is checking against the current org ID and the 
not the org ID too be.


Further testing revealed that if the enabled at boot template belongs to 
the default organization instead of being global, it may produce a 500 
server error when trying to change organizations. This happens even though 
the template itself gets unselected during the process. It must be first 
deselected, save, then change the organization. Otherwise, just ensure that 
the initial default template is global and then you're only faced with the 
original issue.


I'm looking through the source now to find the organization validation 
code. 


Any suggestions would be greatly appreciated.


Cheers,


Jon


-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to