Hey Jon,

On Friday, March 24, 2017 at 9:51:41 PM UTC+1, Jon Mitchell wrote:
>
> 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.
>

Yes, this is a bug.

I've been able to replicate the issue. 

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 have not understood how to reproduce the issue, could you list the steps 
in order to replicate it please?
 

> I'm looking through the source now to find the organization validation 
> code. 
>
 
It may be a bit complex if you are not experienced with python and django:
https://github.com/openwisp/openwisp-controller/blob/master/openwisp_controller/config/models.py#L28-L54

Any suggestions would be greatly appreciated.
>

Thanks for this report.

Federico
 

-- 
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