(commcare_user, domain)
Turns demo mode ON for commcare_user, and resets restore to latest
Turns demo mode ON for commcare_user, and resets restore to latest
Turns demo mode ON for commcare_user and resets restore to latest
def turn_on_demo_mode(commcare_user, domain):
    """
    Turns demo mode ON for commcare_user, and resets restore to latest
    """
    try:
        # the order of following two is important, because the restore XML will contain
        # <data user_type='demo'> only if commcare_user.is_demo_user is True
        commcare_user.is_demo_user = True
        reset_demo_user_restore(commcare_user, domain)
        return {'errors': []}
    except Exception as e:
        notify_exception(None, message=str(e))
        return {'errors': [
            _("Something went wrong in creating restore for the user. Please try again or report an issue")
        ]}
def turn_on_demo_mode ( commcare_user , domain ) : try : # the order of following two is important, because the restore XML will contain # <data user_type='demo'> only if commcare_user.is_demo_user is True commcare_user . is_demo_user = True reset_demo_user_restore ( commcare_user , domain ) return { 'errors' : [ ] } except Exception as e : notify_exception ( None , message = str ( e ) ) return { 'errors' : [ _ ( "Something went wrong in creating restore for the user. Please try again or report an issue" ) ] }