(domain, mobile_worker_id=None)
return apps
Unset practice user for apps that have a practice user configured directly or
    on a build profile of apps in the domain. If a mobile_worker_id is specified,
    only apps configured with that user will be unset

    returns:
        list of apps on which the practice user was unset

    kwargs:
        mobile_worker_id: id of mobile worker. If this is specified, only those apps
        configured with this mobile worker will be unset. If not, apps that are configured
        with any mobile worker are unset
Unset practice user for apps that have a practice user configured directly or
    on a build profile of apps in the domain. If a mobile_worker_id is specified,
    only apps configured with that user will be unset
Unset practice user for apps that have a practice user configured directly or on a build profile of apps in the domain . If a mobile_worker_id is specified only apps configured with that user will be unset
def unset_practice_mode_configured_apps(domain, mobile_worker_id=None):
    """
    Unset practice user for apps that have a practice user configured directly or
    on a build profile of apps in the domain. If a mobile_worker_id is specified,
    only apps configured with that user will be unset

    returns:
        list of apps on which the practice user was unset

    kwargs:
        mobile_worker_id: id of mobile worker. If this is specified, only those apps
        configured with this mobile worker will be unset. If not, apps that are configured
        with any mobile worker are unset
    """

    def unset_user(app_or_profile):
        if mobile_worker_id:
            if app_or_profile.practice_mobile_worker_id == mobile_worker_id:
                app_or_profile.practice_mobile_worker_id = None
        else:
            if app_or_profile.practice_mobile_worker_id:
                app_or_profile.practice_mobile_worker_id = None

    apps = get_practice_mode_configured_apps(domain, mobile_worker_id)
    for app in apps:
        unset_user(app)
        for profile in app.build_profiles.values():
            unset_user(profile)
        app.save()

    return apps
def unset_practice_mode_configured_apps ( domain , mobile_worker_id = None ) : def unset_user ( app_or_profile ) : if mobile_worker_id : if app_or_profile . practice_mobile_worker_id == mobile_worker_id : app_or_profile . practice_mobile_worker_id = None else : if app_or_profile . practice_mobile_worker_id : app_or_profile . practice_mobile_worker_id = None apps = get_practice_mode_configured_apps ( domain , mobile_worker_id ) for app in apps : unset_user ( app ) for profile in app . build_profiles . values ( ) : unset_user ( profile ) app . save ( ) return apps