(self, user_id=None)
return group
Returns a fake group object that cannot be saved.

        This is used for giving users access via case sharing groups, without
        having a real group for every location that we have to manage/hide.
Returns a fake group object that cannot be saved.
Returns a fake group object that cannot be saved .
def case_sharing_group_object(self, user_id=None):
        """
        Returns a fake group object that cannot be saved.

        This is used for giving users access via case sharing groups, without
        having a real group for every location that we have to manage/hide.
        """
        from corehq.apps.groups.models import UnsavableGroup

        group = UnsavableGroup(
            domain=self.domain,
            users=[user_id] if user_id else [],
            last_modified=datetime.utcnow(),
            name=self.get_path_display() + '-Cases',
            _id=self.location_id,
            case_sharing=True,
            reporting=False,
            metadata={
                'commcare_location_type': self.location_type.name,
                'commcare_location_name': self.name,
            },
        )

        for key, val in self.metadata.items():
            group.metadata['commcare_location_' + key] = val

        return group
def case_sharing_group_object ( self , user_id = None ) : from corehq . apps . groups . models import UnsavableGroup group = UnsavableGroup ( domain = self . domain , users = [ user_id ] if user_id else [ ] , last_modified = datetime . utcnow ( ) , name = self . get_path_display ( ) + '-Cases' , _id = self . location_id , case_sharing = True , reporting = False , metadata = { 'commcare_location_type' : self . location_type . name , 'commcare_location_name' : self . name , } , ) for key , val in self . metadata . items ( ) : group . metadata [ 'commcare_location_' + key ] = val return group