Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new script for withdrawing anon preprint w/o error #1212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function() {
var or3client = lib.or3client;

var CONF = 'OpenReview.net/Anonymous_Preprint';
var CONFERENCEPHRASE = "OpenReview Anonymous Preprint";
or3client.or3request(or3client.notesUrl + '?id=' + note.forum, {}, 'GET', token)
.then(result => {
if (result.notes.length > 0){
var blindedNote = result.notes[0];

var milliseconds = (new Date).getTime();
blindedNote.ddate = milliseconds
blindedNote.content = {
authorids: blindedNote.content.authorids,
authors: blindedNote.content.author,
_bibtex: blindedNote.content._bibtex
}
return or3client.or3request(or3client.notesUrl, blindedNote, 'POST', token);
} else {
return Promise.reject('No notes with the id ' + note.referent + ' were found');
}
})
.then(result => or3client.or3request(or3client.notesUrl + '?id=' + note.forum, {}, 'GET', token))
.then(result => {
var blindedNote = result.notes[0];
author_mail ={
"groups": blindedNote.content.authorids,
"subject": "Your submission to " + CONFERENCEPHRASE + " has been withdrawn",
"message": "Your submission to " + CONFERENCEPHRASE + " has been withdrawn. If this was a mistake, please contact OpenReview Support."
};
return or3client.or3request(or3client.mailUrl, author_mail, 'POST', token);

})
.then(result => done())
.catch(error => done(error));
return true;
}