What if autoset_owner_id is passed in as true in one call to
add_create_block, and is false in the other?


On Fri, Oct 25, 2013 at 9:26 AM, Daniel Roberts <notifications@github.com>wrote:

> In corehq/apps/app_manager/suite_xml.py:
>
> > @@ -592,6 +600,13 @@ def get_detail_id_safe(module, detail_type):
> >                      )
> >                  ))
> >
> > +        def add_case_sharing_assertion(e):
> > +            if self.app.case_sharing:
>
> This PR interacts with this feature in a way that needs to you take it
> into account, specifically these lines:
> https://github.com/dimagi/commcare-hq/pull/1514/files#diff-2741d99380866b8e6c54177b973c696cR743and
> https://github.com/dimagi/commcare-hq/pull/1514/files#diff-2741d99380866b8e6c54177b973c696cR866
>
> Basically, if autoset_owner_id is passed in as true (the previous default)
> then you need the assertion; if it's false for both those two lines, then
> you shouldn't add the assertion.
>
> The reason for this is that the assertion is there so that later when you
> autoset the owner_id inside the form, it doesn't crash when looking up the
> group. If, however, the person making the app wants to set the owner_id
> themselves, then we can't do any of this error checking for them and thus
> shouldn't include this assertion. (They might have a more complex pattern
> in which there doesn't have to be exactly one group.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dimagi/commcare-hq/pull/1567/files#r7215434>
> .
>