Ejemplo n.º 1
0
    def _create_curation_ticket(obj, eng):
        from invenio.modules.access.control import acc_get_user_email

        recid = obj.extra_data.get('recid')
        record_url = obj.extra_data.get('url')

        user_email = acc_get_user_email(obj.id_user)

        bai = ""
        if obj.data.get("bai"):
            bai = "[{}]".format(obj.data.get("bai"))
        subject = "Curation needed for author {} {}".format(
            obj.data.get("name").get("preferred_name"),
            bai
        )
        body = render_template(
            template,
            email=user_email,
            object=obj,
            recid=recid,
            record_url=record_url,
            user_comment=obj.extra_data.get("comments", ""),
        ).strip()

        submit_rt_ticket(
            obj=obj,
            queue=queue,
            subject=subject,
            body=body,
            requestors=user_email,
            ticket_id_key=ticket_id_key
        )
Ejemplo n.º 2
0
    def _create_curator_ticket_update(obj, eng):
        from invenio.base.globals import cfg

        user_email = acc_get_user_email(obj.id_user)
        recid = obj.data.get("recid", "")

        subject = "Your update to author {} on INSPIRE".format(
            obj.data.get("name").get("preferred_name")
        )
        record_url = os.path.join(cfg["AUTHORS_UPDATE_BASE_URL"], "record",
                                  str(recid))
        body = render_template(
            template,
            email=user_email,
            url=record_url,
            bibedit_url=record_url + "/edit",
            user_comment=obj.extra_data.get("comments", ""),
        ).strip()

        submit_rt_ticket(
            obj=obj,
            queue=queue,
            subject=subject,
            body=body,
            requestors=user_email,
            ticket_id_key=ticket_id_key
        )
Ejemplo n.º 3
0
    def _create_curator_ticket_new(obj, eng):
        user_email = acc_get_user_email(obj.id_user)

        subject = "Your suggestion to INSPIRE: author {}".format(
            obj.data.get("name").get("preferred_name")
        )
        body = render_template(
            template,
            email=user_email,
            object=obj,
            user_comment=obj.extra_data.get("comments", ""),
        ).strip()

        submit_rt_ticket(
            obj=obj,
            queue=queue,
            subject=subject,
            body=body,
            requestors=user_email,
            ticket_id_key=ticket_id_key
        )