def METHOD_NAME(app_extension):
    def is_active(app):
        if app.is_active:
            return app_extension
        return None
    if not app_extension:
        return None
    return (
        AppByIdLoader(info.context).load(app_extension.app_id).then(is_active)
    )