예제 #1
0
    def _create_curation_ticket(obj, eng):
        from invenio_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
        )
예제 #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
        )
예제 #3
0
    def _create_curation_ticket(obj, eng):
        recid = obj.extra_data.get('recid')
        record_url = obj.extra_data.get('url')

        try:
            user_email = User.query.get(obj.id_user).email
        except AttributeError:
            user_email = ''

        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
        )
예제 #4
0
    def _create_curator_ticket_update(obj, eng):
        try:
            user_email = User.query.get(obj.id_user).email
        except AttributeError:
            user_email = ''
        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(current_app.config["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
        )
예제 #5
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
        )
예제 #6
0
    def _create_curator_ticket_new(obj, eng):
        try:
            user_email = User.query.get(obj.id_user).email
        except AttributeError:
            user_email = ''

        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
        )