A management command to remove the default outlet parentage problem

Last one of these hopefully.. This just goes through and corrects all of the domains that have problems due to the old default outlet config.
I just manually checked/fixed these since it would have taken longer to
push a fix for it. There were only 3-4 domains with such problems, and each
only 1-3 outlets. Except PSI, they're just jacked.


On Wed, Jul 16, 2014 at 1:36 PM, Cory Zue <notifications@github.com> wrote:

> In corehq/apps/commtrack/management/commands/fix_outlet_parentage.py:
>
> > +        if outlet:
> > +            return outlet[0]
> > +        else:
> > +            return []
> > +
> > +    def handle(self, *args, **options):
> > +        domains = Domain.get_all()
> > +
> > +        error_domains = []
> > +
> > +        for d in domains:
> > +            if d.commtrack_enabled:
> > +                outlet = self.find_outlet_type(d.commtrack_settings.location_types)
> > +                if outlet:
> > +                    if self.is_still_default_outlet_config(outlet):
> > +                        outlet.allowed_parents = ['village']
>
> do we need to add a check if any outlets already have parents that are
> blocks? or is that covered elsewhere?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dimagi/commcare-hq/pull/3867/files#r15014464>.
>