Esempio n. 1
0
def notify_reviewers(recid, version):
    message = request.form["message"]

    submission = HEPSubmission.query.filter_by(publication_recid=recid, version=version).first()
    try:
        current_user_obj = get_user_from_id(current_user.get_id())
        send_new_upload_email(recid, current_user_obj, message=message)

        submission.reviewers_notified = True
        db.session.add(submission)
        db.session.commit()

        return jsonify({"status": "success"})
    except NoReviewersException:
        return jsonify({"status": "error", "message": "There are no reviewers for this submission."})
    except Exception as e:
        db.session.rollback()
        return jsonify({"status": "error", "message": e.__str__()})
Esempio n. 2
0
def notify_reviewers(recid, version):
    message = request.form['message']

    submission = HEPSubmission.query.filter_by(publication_recid=recid, version=version).first()
    try:
        current_user_obj = get_user_from_id(current_user.get_id())
        send_new_upload_email(recid, current_user_obj, message=message)

        submission.reviewers_notified = True
        db.session.add(submission)
        db.session.commit()

        return jsonify({"status": "success"})
    except NoReviewersException:
        return jsonify({"status": "error", "message": "There are no reviewers for this submission."})
    except Exception as e:
        db.session.rollback()
        return jsonify({"status": "error", "message": e.__str__()})