diff --git a/cronjob_production.sh b/cronjob_production.sh index 844269c99fce142ebacc0e7caf176b3c84888f5a..645a7b10bfa68bb34363053f06cfe09634a47839 100644 --- a/cronjob_production.sh +++ b/cronjob_production.sh @@ -3,4 +3,4 @@ cd /home/jscaux/webapps/scipost/SciPost_v1/ export DJANGO_SETTINGS_MODULE='SciPost_v1.settings.production' -python3.5 manage.py remind_fellows_to_submit_report +/usr/local/bin/python3.5 manage.py remind_fellows_to_submit_report diff --git a/scipost/db/constants_migration_0043.py b/scipost/db/constants_migration_0043.py deleted file mode 100644 index deeea736aa2e6bd5cf8bc87c293bb76fabddb815..0000000000000000000000000000000000000000 --- a/scipost/db/constants_migration_0043.py +++ /dev/null @@ -1,49 +0,0 @@ -collegeMembers = ( - {'name': 'Sabine Andergassen', 'title': 'Prof.', 'link': 'https://www.uni-tuebingen.de/en/faculties/faculty-of-science/departments/physics/institutes/institute-for-theoretical-physics/research-groups/andergassen-group.html', 'subtitle': 'Tübingen'}, - {'name': 'Fakher Assaad', 'title': 'Prof.', 'link': 'http://www.physik.uni-wuerzburg.de/~assaad/', 'subtitle': 'Würzbrug'}, - {'name': 'Claudio Attaccalite', 'title': 'Dr', 'link': 'http://www.attaccalite.com', 'subtitle': 'Marseille'}, - {'name': 'Denis Bartolo', 'title': 'Prof.', 'link': 'https://denis114.wordpress.com', 'subtitle': 'ENS Lyon'}, - {'name': 'Laura Baudis', 'title': 'Prof.', 'link': 'http://www.physik.unizh.ch/~lbaudis/index.html', 'subtitle': 'Zurich'}, - {'title': 'Prof.', 'link': 'http://www.lorentz.leidenuniv.nl/beenakker/', 'subtitle': 'Leiden', 'name': 'Carlo Beenakker'}, - {'title': 'Prof.', 'link': 'https://www.coulomb.univ-montp2.fr/perso/ludovic.berthier/', 'subtitle': 'Montpellier', 'name': 'Ludovic Berthier'}, - {'title': 'Prof.', 'link': 'http://ipht.cea.fr/Pisp/giulio.biroli/index_en.php', 'subtitle': 'CEA Saclay', 'name': 'Giulio Biroli'}, - {'title': 'Prof.', 'link': 'http://www.en.physik.uni-muenchen.de/personen/professoren/bloch/index.html', 'subtitle': 'LMU Munich', 'name': 'Immanuel Bloch'}, - {'title': 'Prof.', 'link': 'https://staff.fnwi.uva.nl/j.deboer/', 'subtitle': 'U. van Amsterdam', 'name': 'Jan de Boer'}, - {'title': 'Prof.', 'link': 'http://www.uva.nl/en/about-the-uva/organisation/staff-members/content/b/o/d.bonn/d.bonn.html', 'subtitle': 'U. van Amsterdam', 'name': 'Daniel Bonn'}, - {'title': 'Prof.', 'link': 'http://www.statphys.sissa.it/wordpress/?page_id=1731', 'subtitle': 'SISSA', 'name': 'Pasquale Calabrese'}, - {'title': 'Prof.', 'link': 'http://personalpages.to.infn.it/~caselle/index_en.html', 'subtitle': 'Torino', 'name': 'Michele Caselle'}, - {'title': 'Prof.', 'link': 'http://www.saha.ac.in/cmp/bikask.chakrabarti/bikas.html', 'subtitle': 'Kolkata', 'name': 'Bikas Chakrabarti'}, - {'title': 'Prof.', 'link': 'http://www.tcm.phy.cam.ac.uk/~nrc25/', 'subtitle': 'Cambridge', 'name': 'Nigel Cooper'}, - {'title': 'Prof.', 'link': 'http://physics.cornell.edu/csaba-csaki', 'subtitle': 'Cornell', 'name': 'Csaba Csaki'}, - {'title': 'Prof.', 'link': 'http://theory.tifr.res.in/~kedar/', 'subtitle': 'TIFR Mumbai', 'name': 'Kedar Damle'}, - {'title': 'Prof.', 'link': 'http://researchers.uq.edu.au/researcher/1134', 'subtitle': 'U. of Queensland', 'name': 'Matthew Davis'}, - {'title': 'Prof.', 'link': 'http://www-thphys.physics.ox.ac.uk/people/FabianEssler/', 'subtitle': 'U. of Oxford', 'name': 'Fabian Essler'}, - {'title': 'Prof.', 'link': 'http://www.pd.infn.it/~feruglio/', 'subtitle': 'Padova, INFN', 'name': 'Ferruccio Feruglio'}, - {'title': 'Prof.', 'link': 'http://www.ms.unimelb.edu.au/~jdgier@unimelb/', 'subtitle': 'U. of Melbourne', 'name': 'Jan de Gier'}, - {'title': 'Prof.', 'link': 'http://www.desy.de/about_desy/leading_scientists/beate_heinemann/index_eng.html', 'subtitle': 'DESY; Freiburg', 'name': 'Beate Heinemann'}, - {'title': 'Prof.', 'link': 'http://katzgraber.org', 'subtitle': 'Texas A&M', 'name': 'Helmut Katzgraber'}, - {'title': 'Prof.', 'link': 'https://web.physik.rwth-aachen.de/~mkraemer/', 'subtitle': 'RWTH Aachen', 'name': 'Michael Krämer'}, - {'title': 'Prof.', 'link': 'https://www.pmmh.espci.fr/~jorge/', 'subtitle': 'PMMH Paris, CNRS', 'name': 'Jorge Kurchan'}, - {'title': 'Prof.', 'link': 'https://vivo.brown.edu/display/glandsbe', 'subtitle': 'Brown Univ.', 'name': 'Greg Landsberg'}, - {'title': 'Prof.', 'link': 'https://www.mpg.de/6812374/chem_physik_fester_stoffe_mackenzie', 'subtitle': 'MPICPS Dresden, St-Andrews', 'name': 'Andrew P. MacKenzie'}, - {'title': 'Prof.', 'link': 'http://www.ens-lyon.fr/PHYSIQUE/presentation/annuaire/maillet-jean-michel', 'subtitle': 'ENS Lyon', 'name': 'Jean Michel Maillet'}, - {'title': 'Prof.', 'link': 'https://www.mpg.de/343435/physik_komplexer_systeme_wissM28', 'subtitle': 'MPIPKS Dresden', 'name': 'Roderich Moessner'}, - {'title': 'Prof.', 'link': 'https://www.uibk.ac.at/exphys/ultracold/people/christoph.naegerl/', 'subtitle': 'Innsbruck', 'name': 'Hanns-Christoph Nägerl'}, - {'title': 'Prof.', 'link': 'http://www.physics.miami.edu/~nepomechie/', 'subtitle': 'U. of Miami', 'name': 'Rafael Nepomechie'}, - {'title': 'Prof.', 'link': 'https://staff.fnwi.uva.nl/b.nienhuis/', 'subtitle': 'U. van Amsterdam', 'name': 'Bernard Nienhuis'}, - {'title': 'Prof.', 'link': 'http://www.lpthe.jussieu.fr/~pioline/', 'subtitle': 'LPTHE Jussieu', 'name': 'Boris Pioline'}, - {'title': 'Prof.', 'link': 'https://www.uu.nl/staff/RHHGvanRoij/0', 'subtitle': 'Utrecht', 'name': 'René van Roij'}, - {'title': 'Prof.', 'link': 'http://www.thp.uni-koeln.de/rosch', 'subtitle': 'U. of Cologne', 'name': 'Achim Rosch'}, - {'title': 'Prof.', 'link': 'http://saleur.sandvox.net', 'subtitle': 'CEA Saclay/USC', 'name': 'Hubert Saleur'}, - {'title': 'Prof.', 'link': 'http://www.phy.ohiou.edu/people/faculty/sandler.html', 'subtitle': 'Ohio', 'name': 'Nancy Sandler'}, - {'title': 'Dr.', 'link': 'http://www.sussex.ac.uk/profiles/320359', 'subtitle': 'Sussex', 'name': 'Veronica Sanz'}, - {'title': 'Prof.', 'link': 'http://www-thphys.physics.ox.ac.uk/people/SubirSarkar/', 'subtitle': 'Oxford; Niels Bohr Institute', 'name': 'Subir Sarkar'}, - {'title': 'Prof.', 'link': 'https://staff.fnwi.uva.nl/c.j.m.schoutens/', 'subtitle': 'U. van Amsterdam', 'name': 'Kareljan Schoutens'}, - {'title': 'Dr', 'link': 'http://www.phys.ens.fr/~guilhem/', 'subtitle': 'ENS Paris', 'name': 'Guilhem Semerjian'}, - {'title': 'Prof.', 'link': 'http://www-thphys.physics.ox.ac.uk/people/SteveSimon/', 'subtitle': 'U. of Oxford', 'name': 'Steve Simon'}, - {'title': 'Prof.', 'link': 'http://bec.science.unitn.it/infm-bec/people/stringari.html', 'subtitle': 'Trento', 'name': 'Sandro Stringari'}, - {'title': 'Prof.', 'link': 'http://www.damtp.cam.ac.uk/user/tong/', 'subtitle': 'Cambridge', 'name': 'David Tong'}, - {'title': 'Prof.', 'link': 'http://www.physique.usherbrooke.ca/pages/en/node/3412', 'subtitle': 'Sherbrooke', 'name': 'André-Marie Tremblay'}, - {'title': 'Prof.', 'link': 'http://trivediresearch.org.ohio-state.edu', 'subtitle': 'Ohio State U.', 'name': 'Nandini Trivedi'}, - {'title': 'Prof.', 'link': 'http://vergassolalab.ucsd.edu', 'subtitle': 'UC Sand Diego', 'name': 'Massimo Vergassola'}, -) diff --git a/scipost/fixtures/contributors.json b/scipost/fixtures/contributors.json deleted file mode 100644 index a4863604278b1460829d963d108b4db098579aef..0000000000000000000000000000000000000000 --- a/scipost/fixtures/contributors.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "model": "auth.user", - "pk": 1, - "fields": { - "password": "pbkdf2_sha256$30000$iqtXX60Ahqcx$IKfNZNSMbSca/agzPXHTdEej3dXhQi1sK/MCrBTnuW4=", - "last_login": null, - "is_superuser": false, - "username": "Test", - "first_name": "Firstname", - "last_name": "Testuser", - "email": "testuser@test.com", - "is_staff": false, - "is_active": true, - "date_joined": "2016-12-14T20:41:31.282Z", - "groups": [ - 6 - ], - "user_permissions": [] - } - }, - { - "model": "scipost.contributor", - "pk": 2, - "fields": { - "user": 1, - "status": 1, - "title": "MR", - "vetted_by": 2 - } - } -] diff --git a/scipost/fixtures/groups.json b/scipost/fixtures/groups.json deleted file mode 100644 index 82fafdc4738001941947ba92ecf8d9a5749ad11d..0000000000000000000000000000000000000000 --- a/scipost/fixtures/groups.json +++ /dev/null @@ -1,116 +0,0 @@ -[ -{ - "model": "auth.group", - "pk": 1, - "fields": { - "name": "SciPost Administrators", - "permissions": [ - 143, - 130, - 131, - 148, - 128, - 147, - 139, - 137, - 140, - 126, - 138, - 142 - ] - } -}, -{ - "model": "auth.group", - "pk": 2, - "fields": { - "name": "Advisory Board", - "permissions": [ - 128 - ] - } -}, -{ - "model": "auth.group", - "pk": 3, - "fields": { - "name": "Editorial Administrators", - "permissions": [ - 143, - 148, - 147, - 149, - 142 - ] - } -}, -{ - "model": "auth.group", - "pk": 4, - "fields": { - "name": "Editorial College", - "permissions": [ - 144, - 145, - 142, - 132 - ] - } -}, -{ - "model": "auth.group", - "pk": 5, - "fields": { - "name": "Vetting Editors", - "permissions": [ - 139, - 137, - 140, - 138 - ] - } -}, -{ - "model": "auth.group", - "pk": 6, - "fields": { - "name": "Registered Contributors", - "permissions": [ - 134, - 146, - 135, - 136, - 133, - 141 - ] - } -}, -{ - "model": "auth.group", - "pk": 7, - "fields": { - "name": "Testers", - "permissions": [] - } -}, -{ - "model": "auth.group", - "pk": 8, - "fields": { - "name": "Ambassadors", - "permissions": [ - 128 - ] - } -}, -{ - "model": "auth.group", - "pk": 9, - "fields": { - "name": "Junior Ambassadors", - "permissions": [ - 127 - ] - } -} -] diff --git a/scipost/fixtures/permissions.json b/scipost/fixtures/permissions.json deleted file mode 100644 index a718c3476c978d97c20a15d8b81f01ac0500596f..0000000000000000000000000000000000000000 --- a/scipost/fixtures/permissions.json +++ /dev/null @@ -1,1343 +0,0 @@ -[ -{ - "model": "auth.permission", - "pk": 1, - "fields": { - "name": "Can add log entry", - "content_type": 1, - "codename": "add_logentry" - } -}, -{ - "model": "auth.permission", - "pk": 2, - "fields": { - "name": "Can change log entry", - "content_type": 1, - "codename": "change_logentry" - } -}, -{ - "model": "auth.permission", - "pk": 3, - "fields": { - "name": "Can delete log entry", - "content_type": 1, - "codename": "delete_logentry" - } -}, -{ - "model": "auth.permission", - "pk": 4, - "fields": { - "name": "Can add user", - "content_type": 2, - "codename": "add_user" - } -}, -{ - "model": "auth.permission", - "pk": 5, - "fields": { - "name": "Can change user", - "content_type": 2, - "codename": "change_user" - } -}, -{ - "model": "auth.permission", - "pk": 6, - "fields": { - "name": "Can delete user", - "content_type": 2, - "codename": "delete_user" - } -}, -{ - "model": "auth.permission", - "pk": 7, - "fields": { - "name": "Can add group", - "content_type": 3, - "codename": "add_group" - } -}, -{ - "model": "auth.permission", - "pk": 8, - "fields": { - "name": "Can change group", - "content_type": 3, - "codename": "change_group" - } -}, -{ - "model": "auth.permission", - "pk": 9, - "fields": { - "name": "Can delete group", - "content_type": 3, - "codename": "delete_group" - } -}, -{ - "model": "auth.permission", - "pk": 10, - "fields": { - "name": "Can add permission", - "content_type": 4, - "codename": "add_permission" - } -}, -{ - "model": "auth.permission", - "pk": 11, - "fields": { - "name": "Can change permission", - "content_type": 4, - "codename": "change_permission" - } -}, -{ - "model": "auth.permission", - "pk": 12, - "fields": { - "name": "Can delete permission", - "content_type": 4, - "codename": "delete_permission" - } -}, -{ - "model": "auth.permission", - "pk": 13, - "fields": { - "name": "Can add content type", - "content_type": 5, - "codename": "add_contenttype" - } -}, -{ - "model": "auth.permission", - "pk": 14, - "fields": { - "name": "Can change content type", - "content_type": 5, - "codename": "change_contenttype" - } -}, -{ - "model": "auth.permission", - "pk": 15, - "fields": { - "name": "Can delete content type", - "content_type": 5, - "codename": "delete_contenttype" - } -}, -{ - "model": "auth.permission", - "pk": 16, - "fields": { - "name": "Can add session", - "content_type": 6, - "codename": "add_session" - } -}, -{ - "model": "auth.permission", - "pk": 17, - "fields": { - "name": "Can change session", - "content_type": 6, - "codename": "change_session" - } -}, -{ - "model": "auth.permission", - "pk": 18, - "fields": { - "name": "Can delete session", - "content_type": 6, - "codename": "delete_session" - } -}, -{ - "model": "auth.permission", - "pk": 19, - "fields": { - "name": "Can add captcha store", - "content_type": 7, - "codename": "add_captchastore" - } -}, -{ - "model": "auth.permission", - "pk": 20, - "fields": { - "name": "Can change captcha store", - "content_type": 7, - "codename": "change_captchastore" - } -}, -{ - "model": "auth.permission", - "pk": 21, - "fields": { - "name": "Can delete captcha store", - "content_type": 7, - "codename": "delete_captchastore" - } -}, -{ - "model": "auth.permission", - "pk": 22, - "fields": { - "name": "Can add user object permission", - "content_type": 8, - "codename": "add_userobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 23, - "fields": { - "name": "Can change user object permission", - "content_type": 8, - "codename": "change_userobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 24, - "fields": { - "name": "Can delete user object permission", - "content_type": 8, - "codename": "delete_userobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 25, - "fields": { - "name": "Can add group object permission", - "content_type": 9, - "codename": "add_groupobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 26, - "fields": { - "name": "Can change group object permission", - "content_type": 9, - "codename": "change_groupobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 27, - "fields": { - "name": "Can delete group object permission", - "content_type": 9, - "codename": "delete_groupobjectpermission" - } -}, -{ - "model": "auth.permission", - "pk": 28, - "fields": { - "name": "Can add commentary", - "content_type": 10, - "codename": "add_commentary" - } -}, -{ - "model": "auth.permission", - "pk": 29, - "fields": { - "name": "Can change commentary", - "content_type": 10, - "codename": "change_commentary" - } -}, -{ - "model": "auth.permission", - "pk": 30, - "fields": { - "name": "Can delete commentary", - "content_type": 10, - "codename": "delete_commentary" - } -}, -{ - "model": "auth.permission", - "pk": 31, - "fields": { - "name": "Can add comment", - "content_type": 11, - "codename": "add_comment" - } -}, -{ - "model": "auth.permission", - "pk": 32, - "fields": { - "name": "Can change comment", - "content_type": 11, - "codename": "change_comment" - } -}, -{ - "model": "auth.permission", - "pk": 33, - "fields": { - "name": "Can delete comment", - "content_type": 11, - "codename": "delete_comment" - } -}, -{ - "model": "auth.permission", - "pk": 34, - "fields": { - "name": "Can add issue", - "content_type": 12, - "codename": "add_issue" - } -}, -{ - "model": "auth.permission", - "pk": 35, - "fields": { - "name": "Can change issue", - "content_type": 12, - "codename": "change_issue" - } -}, -{ - "model": "auth.permission", - "pk": 36, - "fields": { - "name": "Can delete issue", - "content_type": 12, - "codename": "delete_issue" - } -}, -{ - "model": "auth.permission", - "pk": 37, - "fields": { - "name": "Can add journal", - "content_type": 13, - "codename": "add_journal" - } -}, -{ - "model": "auth.permission", - "pk": 38, - "fields": { - "name": "Can change journal", - "content_type": 13, - "codename": "change_journal" - } -}, -{ - "model": "auth.permission", - "pk": 39, - "fields": { - "name": "Can delete journal", - "content_type": 13, - "codename": "delete_journal" - } -}, -{ - "model": "auth.permission", - "pk": 40, - "fields": { - "name": "Can add unregistered author", - "content_type": 14, - "codename": "add_unregisteredauthor" - } -}, -{ - "model": "auth.permission", - "pk": 41, - "fields": { - "name": "Can change unregistered author", - "content_type": 14, - "codename": "change_unregisteredauthor" - } -}, -{ - "model": "auth.permission", - "pk": 42, - "fields": { - "name": "Can delete unregistered author", - "content_type": 14, - "codename": "delete_unregisteredauthor" - } -}, -{ - "model": "auth.permission", - "pk": 43, - "fields": { - "name": "Can add deposit", - "content_type": 15, - "codename": "add_deposit" - } -}, -{ - "model": "auth.permission", - "pk": 44, - "fields": { - "name": "Can change deposit", - "content_type": 15, - "codename": "change_deposit" - } -}, -{ - "model": "auth.permission", - "pk": 45, - "fields": { - "name": "Can delete deposit", - "content_type": 15, - "codename": "delete_deposit" - } -}, -{ - "model": "auth.permission", - "pk": 46, - "fields": { - "name": "Can add publication", - "content_type": 16, - "codename": "add_publication" - } -}, -{ - "model": "auth.permission", - "pk": 47, - "fields": { - "name": "Can change publication", - "content_type": 16, - "codename": "change_publication" - } -}, -{ - "model": "auth.permission", - "pk": 48, - "fields": { - "name": "Can delete publication", - "content_type": 16, - "codename": "delete_publication" - } -}, -{ - "model": "auth.permission", - "pk": 49, - "fields": { - "name": "Can add volume", - "content_type": 17, - "codename": "add_volume" - } -}, -{ - "model": "auth.permission", - "pk": 50, - "fields": { - "name": "Can change volume", - "content_type": 17, - "codename": "change_volume" - } -}, -{ - "model": "auth.permission", - "pk": 51, - "fields": { - "name": "Can delete volume", - "content_type": 17, - "codename": "delete_volume" - } -}, -{ - "model": "auth.permission", - "pk": 52, - "fields": { - "name": "Can add news item", - "content_type": 18, - "codename": "add_newsitem" - } -}, -{ - "model": "auth.permission", - "pk": 53, - "fields": { - "name": "Can change news item", - "content_type": 18, - "codename": "change_newsitem" - } -}, -{ - "model": "auth.permission", - "pk": 54, - "fields": { - "name": "Can delete news item", - "content_type": 18, - "codename": "delete_newsitem" - } -}, -{ - "model": "auth.permission", - "pk": 55, - "fields": { - "name": "Can add precooked email", - "content_type": 19, - "codename": "add_precookedemail" - } -}, -{ - "model": "auth.permission", - "pk": 56, - "fields": { - "name": "Can change precooked email", - "content_type": 19, - "codename": "change_precookedemail" - } -}, -{ - "model": "auth.permission", - "pk": 57, - "fields": { - "name": "Can delete precooked email", - "content_type": 19, - "codename": "delete_precookedemail" - } -}, -{ - "model": "auth.permission", - "pk": 58, - "fields": { - "name": "Can add affiliation object", - "content_type": 20, - "codename": "add_affiliationobject" - } -}, -{ - "model": "auth.permission", - "pk": 59, - "fields": { - "name": "Can change affiliation object", - "content_type": 20, - "codename": "change_affiliationobject" - } -}, -{ - "model": "auth.permission", - "pk": 60, - "fields": { - "name": "Can delete affiliation object", - "content_type": 20, - "codename": "delete_affiliationobject" - } -}, -{ - "model": "auth.permission", - "pk": 61, - "fields": { - "name": "Can add registration invitation", - "content_type": 21, - "codename": "add_registrationinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 62, - "fields": { - "name": "Can change registration invitation", - "content_type": 21, - "codename": "change_registrationinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 63, - "fields": { - "name": "Can delete registration invitation", - "content_type": 21, - "codename": "delete_registrationinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 64, - "fields": { - "name": "Can add spb membership agreement", - "content_type": 22, - "codename": "add_spbmembershipagreement" - } -}, -{ - "model": "auth.permission", - "pk": 65, - "fields": { - "name": "Can change spb membership agreement", - "content_type": 22, - "codename": "change_spbmembershipagreement" - } -}, -{ - "model": "auth.permission", - "pk": 66, - "fields": { - "name": "Can delete spb membership agreement", - "content_type": 22, - "codename": "delete_spbmembershipagreement" - } -}, -{ - "model": "auth.permission", - "pk": 67, - "fields": { - "name": "Can add supporting partner", - "content_type": 23, - "codename": "add_supportingpartner" - } -}, -{ - "model": "auth.permission", - "pk": 68, - "fields": { - "name": "Can change supporting partner", - "content_type": 23, - "codename": "change_supportingpartner" - } -}, -{ - "model": "auth.permission", - "pk": 69, - "fields": { - "name": "Can delete supporting partner", - "content_type": 23, - "codename": "delete_supportingpartner" - } -}, -{ - "model": "auth.permission", - "pk": 70, - "fields": { - "name": "Can add arc", - "content_type": 24, - "codename": "add_arc" - } -}, -{ - "model": "auth.permission", - "pk": 71, - "fields": { - "name": "Can change arc", - "content_type": 24, - "codename": "change_arc" - } -}, -{ - "model": "auth.permission", - "pk": 72, - "fields": { - "name": "Can delete arc", - "content_type": 24, - "codename": "delete_arc" - } -}, -{ - "model": "auth.permission", - "pk": 73, - "fields": { - "name": "Can add graph", - "content_type": 25, - "codename": "add_graph" - } -}, -{ - "model": "auth.permission", - "pk": 74, - "fields": { - "name": "Can view graph", - "content_type": 25, - "codename": "view_graph" - } -}, -{ - "model": "auth.permission", - "pk": 75, - "fields": { - "name": "Can change graph", - "content_type": 25, - "codename": "change_graph" - } -}, -{ - "model": "auth.permission", - "pk": 76, - "fields": { - "name": "Can delete graph", - "content_type": 25, - "codename": "delete_graph" - } -}, -{ - "model": "auth.permission", - "pk": 77, - "fields": { - "name": "Can add contributor", - "content_type": 26, - "codename": "add_contributor" - } -}, -{ - "model": "auth.permission", - "pk": 78, - "fields": { - "name": "Can change contributor", - "content_type": 26, - "codename": "change_contributor" - } -}, -{ - "model": "auth.permission", - "pk": 79, - "fields": { - "name": "Can delete contributor", - "content_type": 26, - "codename": "delete_contributor" - } -}, -{ - "model": "auth.permission", - "pk": 80, - "fields": { - "name": "Can add authorship claim", - "content_type": 27, - "codename": "add_authorshipclaim" - } -}, -{ - "model": "auth.permission", - "pk": 81, - "fields": { - "name": "Can change authorship claim", - "content_type": 27, - "codename": "change_authorshipclaim" - } -}, -{ - "model": "auth.permission", - "pk": 82, - "fields": { - "name": "Can delete authorship claim", - "content_type": 27, - "codename": "delete_authorshipclaim" - } -}, -{ - "model": "auth.permission", - "pk": 83, - "fields": { - "name": "Can add unavailability period", - "content_type": 28, - "codename": "add_unavailabilityperiod" - } -}, -{ - "model": "auth.permission", - "pk": 84, - "fields": { - "name": "Can change unavailability period", - "content_type": 28, - "codename": "change_unavailabilityperiod" - } -}, -{ - "model": "auth.permission", - "pk": 85, - "fields": { - "name": "Can delete unavailability period", - "content_type": 28, - "codename": "delete_unavailabilityperiod" - } -}, -{ - "model": "auth.permission", - "pk": 86, - "fields": { - "name": "Can add list", - "content_type": 29, - "codename": "add_list" - } -}, -{ - "model": "auth.permission", - "pk": 87, - "fields": { - "name": "Can view list", - "content_type": 29, - "codename": "view_list" - } -}, -{ - "model": "auth.permission", - "pk": 88, - "fields": { - "name": "Can change list", - "content_type": 29, - "codename": "change_list" - } -}, -{ - "model": "auth.permission", - "pk": 89, - "fields": { - "name": "Can delete list", - "content_type": 29, - "codename": "delete_list" - } -}, -{ - "model": "auth.permission", - "pk": 90, - "fields": { - "name": "Can add node", - "content_type": 30, - "codename": "add_node" - } -}, -{ - "model": "auth.permission", - "pk": 91, - "fields": { - "name": "Can view node", - "content_type": 30, - "codename": "view_node" - } -}, -{ - "model": "auth.permission", - "pk": 92, - "fields": { - "name": "Can change node", - "content_type": 30, - "codename": "change_node" - } -}, -{ - "model": "auth.permission", - "pk": 93, - "fields": { - "name": "Can delete node", - "content_type": 30, - "codename": "delete_node" - } -}, -{ - "model": "auth.permission", - "pk": 94, - "fields": { - "name": "Can add draft invitation", - "content_type": 31, - "codename": "add_draftinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 95, - "fields": { - "name": "Can change draft invitation", - "content_type": 31, - "codename": "change_draftinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 96, - "fields": { - "name": "Can delete draft invitation", - "content_type": 31, - "codename": "delete_draftinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 97, - "fields": { - "name": "Can add team", - "content_type": 32, - "codename": "add_team" - } -}, -{ - "model": "auth.permission", - "pk": 98, - "fields": { - "name": "Can view team", - "content_type": 32, - "codename": "view_team" - } -}, -{ - "model": "auth.permission", - "pk": 99, - "fields": { - "name": "Can change team", - "content_type": 32, - "codename": "change_team" - } -}, -{ - "model": "auth.permission", - "pk": 100, - "fields": { - "name": "Can delete team", - "content_type": 32, - "codename": "delete_team" - } -}, -{ - "model": "auth.permission", - "pk": 101, - "fields": { - "name": "Can add remark", - "content_type": 33, - "codename": "add_remark" - } -}, -{ - "model": "auth.permission", - "pk": 102, - "fields": { - "name": "Can change remark", - "content_type": 33, - "codename": "change_remark" - } -}, -{ - "model": "auth.permission", - "pk": 103, - "fields": { - "name": "Can delete remark", - "content_type": 33, - "codename": "delete_remark" - } -}, -{ - "model": "auth.permission", - "pk": 104, - "fields": { - "name": "Can add editorial communication", - "content_type": 34, - "codename": "add_editorialcommunication" - } -}, -{ - "model": "auth.permission", - "pk": 105, - "fields": { - "name": "Can change editorial communication", - "content_type": 34, - "codename": "change_editorialcommunication" - } -}, -{ - "model": "auth.permission", - "pk": 106, - "fields": { - "name": "Can delete editorial communication", - "content_type": 34, - "codename": "delete_editorialcommunication" - } -}, -{ - "model": "auth.permission", - "pk": 107, - "fields": { - "name": "Can add referee invitation", - "content_type": 35, - "codename": "add_refereeinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 108, - "fields": { - "name": "Can change referee invitation", - "content_type": 35, - "codename": "change_refereeinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 109, - "fields": { - "name": "Can delete referee invitation", - "content_type": 35, - "codename": "delete_refereeinvitation" - } -}, -{ - "model": "auth.permission", - "pk": 110, - "fields": { - "name": "Can add submission", - "content_type": 36, - "codename": "add_submission" - } -}, -{ - "model": "auth.permission", - "pk": 111, - "fields": { - "name": "Can change submission", - "content_type": 36, - "codename": "change_submission" - } -}, -{ - "model": "auth.permission", - "pk": 112, - "fields": { - "name": "Can delete submission", - "content_type": 36, - "codename": "delete_submission" - } -}, -{ - "model": "auth.permission", - "pk": 113, - "fields": { - "name": "Can take editorial actions", - "content_type": 36, - "codename": "can_take_editorial_actions" - } -}, -{ - "model": "auth.permission", - "pk": 114, - "fields": { - "name": "Can add report", - "content_type": 37, - "codename": "add_report" - } -}, -{ - "model": "auth.permission", - "pk": 115, - "fields": { - "name": "Can change report", - "content_type": 37, - "codename": "change_report" - } -}, -{ - "model": "auth.permission", - "pk": 116, - "fields": { - "name": "Can delete report", - "content_type": 37, - "codename": "delete_report" - } -}, -{ - "model": "auth.permission", - "pk": 117, - "fields": { - "name": "Can add eic recommendation", - "content_type": 38, - "codename": "add_eicrecommendation" - } -}, -{ - "model": "auth.permission", - "pk": 118, - "fields": { - "name": "Can change eic recommendation", - "content_type": 38, - "codename": "change_eicrecommendation" - } -}, -{ - "model": "auth.permission", - "pk": 119, - "fields": { - "name": "Can delete eic recommendation", - "content_type": 38, - "codename": "delete_eicrecommendation" - } -}, -{ - "model": "auth.permission", - "pk": 120, - "fields": { - "name": "Can add editorial assignment", - "content_type": 39, - "codename": "add_editorialassignment" - } -}, -{ - "model": "auth.permission", - "pk": 121, - "fields": { - "name": "Can change editorial assignment", - "content_type": 39, - "codename": "change_editorialassignment" - } -}, -{ - "model": "auth.permission", - "pk": 122, - "fields": { - "name": "Can delete editorial assignment", - "content_type": 39, - "codename": "delete_editorialassignment" - } -}, -{ - "model": "auth.permission", - "pk": 123, - "fields": { - "name": "Can add thesis link", - "content_type": 40, - "codename": "add_thesislink" - } -}, -{ - "model": "auth.permission", - "pk": 124, - "fields": { - "name": "Can change thesis link", - "content_type": 40, - "codename": "change_thesislink" - } -}, -{ - "model": "auth.permission", - "pk": 125, - "fields": { - "name": "Can delete thesis link", - "content_type": 40, - "codename": "delete_thesislink" - } -}, -{ - "model": "auth.permission", - "pk": 126, - "fields": { - "name": "Can vet registration requests", - "content_type": 26, - "codename": "can_vet_registration_requests" - } -}, -{ - "model": "auth.permission", - "pk": 127, - "fields": { - "name": "Can draft registration invitations", - "content_type": 26, - "codename": "can_draft_registration_invitations" - } -}, -{ - "model": "auth.permission", - "pk": 128, - "fields": { - "name": "Can manage registration invitations", - "content_type": 26, - "codename": "can_manage_registration_invitations" - } -}, -{ - "model": "auth.permission", - "pk": 129, - "fields": { - "name": "Can invite Fellows", - "content_type": 26, - "codename": "can_invite_Fellows" - } -}, -{ - "model": "auth.permission", - "pk": 130, - "fields": { - "name": "Can email group members", - "content_type": 26, - "codename": "can_email_group_members" - } -}, -{ - "model": "auth.permission", - "pk": 131, - "fields": { - "name": "Can email particulars", - "content_type": 26, - "codename": "can_email_particulars" - } -}, -{ - "model": "auth.permission", - "pk": 132, - "fields": { - "name": "Can view By-laws of Editorial College", - "content_type": 26, - "codename": "view_bylaws" - } -}, -{ - "model": "auth.permission", - "pk": 133, - "fields": { - "name": "Can submit Comments", - "content_type": 26, - "codename": "can_submit_comments" - } -}, -{ - "model": "auth.permission", - "pk": 134, - "fields": { - "name": "Can express opinion on Comments", - "content_type": 26, - "codename": "can_express_opinion_on_comments" - } -}, -{ - "model": "auth.permission", - "pk": 135, - "fields": { - "name": "Can request opening of Commentara Pages", - "content_type": 26, - "codename": "can_request_commentary_pages" - } -}, -{ - "model": "auth.permission", - "pk": 136, - "fields": { - "name": "Can request Thesis Links", - "content_type": 26, - "codename": "can_request_thesislinks" - } -}, -{ - "model": "auth.permission", - "pk": 137, - "fields": { - "name": "Can vet Commentary page requests", - "content_type": 26, - "codename": "can_vet_commentary_requests" - } -}, -{ - "model": "auth.permission", - "pk": 138, - "fields": { - "name": "Can vet Thesis Link requests", - "content_type": 26, - "codename": "can_vet_thesislink_requests" - } -}, -{ - "model": "auth.permission", - "pk": 139, - "fields": { - "name": "Can vet Authorship claims", - "content_type": 26, - "codename": "can_vet_authorship_claims" - } -}, -{ - "model": "auth.permission", - "pk": 140, - "fields": { - "name": "Can vet submitted Comments", - "content_type": 26, - "codename": "can_vet_comments" - } -}, -{ - "model": "auth.permission", - "pk": 141, - "fields": { - "name": "Can submit manuscript", - "content_type": 26, - "codename": "can_submit_manuscript" - } -}, -{ - "model": "auth.permission", - "pk": 142, - "fields": { - "name": "Can view Submissions Pool", - "content_type": 26, - "codename": "can_view_pool" - } -}, -{ - "model": "auth.permission", - "pk": 143, - "fields": { - "name": "Can assign incoming Submissions to potential Editor-in-charge", - "content_type": 26, - "codename": "can_assign_submissions" - } -}, -{ - "model": "auth.permission", - "pk": 144, - "fields": { - "name": "Can take charge (become Editor-in-charge) of submissions", - "content_type": 26, - "codename": "can_take_charge_of_submissions" - } -}, -{ - "model": "auth.permission", - "pk": 145, - "fields": { - "name": "Can vet submitted Reports", - "content_type": 26, - "codename": "can_vet_submitted_reports" - } -}, -{ - "model": "auth.permission", - "pk": 146, - "fields": { - "name": "Can act as a referee and submit reports on Submissions", - "content_type": 26, - "codename": "can_referee" - } -}, -{ - "model": "auth.permission", - "pk": 147, - "fields": { - "name": "Can prepare recommendations for voting", - "content_type": 26, - "codename": "can_prepare_recommendations_for_voting" - } -}, -{ - "model": "auth.permission", - "pk": 148, - "fields": { - "name": "Can fix the College voting decision", - "content_type": 26, - "codename": "can_fix_College_decision" - } -}, -{ - "model": "auth.permission", - "pk": 149, - "fields": { - "name": "Can publish accepted submission", - "content_type": 26, - "codename": "can_publish_accepted_submission" - } -} -] diff --git a/scipost/migrations/0043_auto_20170318_2237.py b/scipost/migrations/0043_auto_20170318_2237.py index e8bcfa55845b746bc3b616fc4418fc75af9aed1f..231b06e9922cb3800e82fa7f890217adce67d1d7 100644 --- a/scipost/migrations/0043_auto_20170318_2237.py +++ b/scipost/migrations/0043_auto_20170318_2237.py @@ -4,13 +4,14 @@ from __future__ import unicode_literals from django.db import migrations -from ..db.constants_migration_0043 import collegeMembers +# from ..db.constants_migration_0043 import collegeMembers def fill_editorial_college(apps, schema_editor): EditorialCollege = apps.get_model('scipost', 'EditorialCollege') EditorialMember = apps.get_model('scipost', 'EditorialCollegeMember') college, new = EditorialCollege.objects.get_or_create(discipline='Physics') + collegeMembers = [] for member in collegeMembers: EditorialMember.objects.get_or_create(discipline=college, **member) diff --git a/scipost/templates/scipost/personal_page.html b/scipost/templates/scipost/personal_page.html index b5b567f3afe94eb0a76a3955190d5be7725e460f..817781a380fe7627a9a44e130de212d7dd8713c5 100644 --- a/scipost/templates/scipost/personal_page.html +++ b/scipost/templates/scipost/personal_page.html @@ -1,6 +1,7 @@ {% extends 'scipost/base.html' %} {% load bootstrap %} +{% load user_groups %} {% block pagetitle %}: personal page{% endblock pagetitle %} @@ -17,6 +18,17 @@ </div> {% else %} + {# Save all Permission groups into template variables #} + {% is_edcol_admin request.user as is_edcol_admin %} + {% is_scipost_admin request.user as is_scipost_admin %} + {% is_editorial_college request.user as is_editorial_college %} + {% is_advisory_board request.user as is_advisory_board %} + {% is_vetting_editor request.user as is_vetting_editor %} + {% is_ambassador request.user as is_ambassador %} + {% is_junior_ambassador request.user as is_junior_ambassador %} + {% is_registered_contributor request.user as is_registered_contributor %} + {% is_tester request.user as is_tester %} + {% is_production_officer request.user as is_production_officer %} <div class="row"> <div class="col-12"> @@ -33,7 +45,7 @@ <li class="nav-item btn btn-secondary"> <a href="#account" class="nav-link active" data-toggle="tab">Account</a> </li> - {% if 'SciPost Administrators' in user_groups or 'Editorial Administrators' in user_groups or 'Editorial College' in user_groups or 'Advisory Board' in user_groups or 'Vetting Editors' in user_groups or 'Ambassadors' in user_groups or 'Junior Ambassadors' in user_groups %} + {% if is_scipost_admin or is_edcol_admin or is_editorial_college or is_advisory_board or is_vetting_editor or is_ambassador or is_junior_ambassador %} <li class="nav-item btn btn-secondary"> <a href="#editorial-actions" class="nav-link" data-toggle="tab">Editorial Actions</a> </li> @@ -127,34 +139,34 @@ <hr> {% endif %} - {% if 'SciPost Administrators' in user_groups %} + {% if is_scipost_admin %} <h3>You are a SciPost Administrator.</h3> {% endif %} - {% if 'Editorial Administrators' in user_groups %} + {% if is_edcol_admin %} <h3>You are a SciPost Editorial Administrator.</h3> {% endif %} - {% if 'Advisory Board' in user_groups %} + {% if is_advisory_board %} <h3>You are a member of the Advisory Board.</h3> {% endif %} - {% if 'Editorial College' in user_groups %} + {% if is_editorial_college %} <h3>You are a member of the Editorial College.</h3> {% endif %} - {% if 'Vetting Editors' in user_groups %} + {% if is_vetting_editor %} <h3>You are a SciPost Vetting Editor.</h3> {% endif %} - {% if 'Registered Contributors' in user_groups %} + {% if is_registered_contributor %} <h3>You are a Registered Contributor.</h3> {% endif %} - {% if 'Testers' in user_groups %} + {% if is_tester %} <h3>You are a SciPost Tester.</h3> {% endif %} - {% if 'Ambassadors' in user_groups %} + {% if is_ambassador %} <h3>You are a SciPost Ambassador.</h3> {% endif %} - {% if 'Junior Ambassadors' in user_groups %} + {% if is_junior_ambassador %} <h3>You are a SciPost Junior Ambassador.</h3> {% endif %} - {% if 'Production Officers' in user_groups %} + {% if is_production_officer %} <h3>You are a SciPost Production Officer.</h3> {% endif %} @@ -249,7 +261,7 @@ {% endif %} </div><!-- End tab --> - {% if 'SciPost Administrators' in user_groups or 'Editorial Administrators' in user_groups or 'Editorial College' in user_groups or 'Advisory Board' in user_groups or 'Vetting Editors' in user_groups or 'Ambassadors' in user_groups or 'Junior Ambassadors' in user_groups %} + {% if is_scipost_admin or is_edcol_admin or is_editorial_college or is_advisory_board or is_vetting_editor or is_ambassador or is_junior_ambassador %} <!-- Tab: Editorial Actions --> <div class="tab-pane" id="editorial-actions" role="tabpanel"> <div class="row"> @@ -263,7 +275,7 @@ </div> <div class="row"> - {% if 'SciPost Administrators' in user_groups or 'Advisory Board' in user_groups or 'Ambassadors' in user_groups or 'Junior Ambassadors' in user_groups %} + {% if is_scipost_admin or is_advisory_board or is_ambassador or is_junior_ambassador %} <div class="col-md-4"> <h3>Registration actions</h3> <ul> @@ -288,7 +300,7 @@ </ul> {% endif %} - {% if 'SciPost Administrators' in user_groups %} + {% if is_scipost_admin %} <h3>Email communications</h3> <ul> {% if perms.scipost.can_email_group_members %} @@ -314,7 +326,7 @@ {% endif %} <div class="col-md-4"> - {% if 'Vetting Editors' in user_groups or perms.scipost.can_vet_submitted_reports %} + {% if is_vetting_editor or perms.scipost.can_vet_submitted_reports %} <h3>Vetting actions</h3> <ul> {% if perms.scipost.can_vet_commentary_requests %} @@ -335,7 +347,7 @@ </ul> {% endif %} - {% if 'Editorial Administrators' in user_groups %} + {% if is_edcol_admin %} <h3>Editorial Admin actions</h3> <ul> <li><a href="{% url 'submissions:reports_accepted_list' %}">Accepted Reports</a>{% if nr_reports_without_pdf %} ({{nr_reports_without_pdf}} unfinished){% endif %}</li> @@ -358,7 +370,7 @@ {% endif %} </div> - {% if 'Editorial Administrators' in user_groups or 'Editorial College' in user_groups %} + {% if is_edcol_admin or is_editorial_college %} <div class="col-md-4"> <h3>Info</h3> <ul> @@ -379,16 +391,16 @@ {% endif %} </ul> - {% if 'Editorial Administrators' in user_groups %} - <h3>Refereeing overview</h3> - <ul> - <li>View (and act on) outstanding refereeing invitations in the <a href="{% url 'submissions:refereeing_overview' %}">refereeing overview</a></li> - <li><a href="{% url 'stats:statistics' %}">View statistics</a> for submissions, refereeing, publishing</li> - </ul> - <h3>Voting</h3> - <ul> - <li>Prepare Editorial Recommendations for voting via the <a href="{% url 'submissions:pool' %}">Submissions Pool</a> ({{ nr_recommendations_to_prepare_for_voting }})</li> - </ul> + {% if is_edcol_admin %} + <h3>Refereeing overview</h3> + <ul> + <li>View (and act on) outstanding refereeing invitations in the <a href="{% url 'submissions:refereeing_overview' %}">refereeing overview</a></li> + <li><a href="{% url 'stats:statistics' %}">View statistics</a> for submissions, refereeing, publishing</li> + </ul> + <h3>Voting</h3> + <ul> + <li>Prepare Editorial Recommendations for voting via the <a href="{% url 'submissions:pool' %}">Submissions Pool</a> ({{ nr_recommendations_to_prepare_for_voting }})</li> + </ul> {% endif %} </div> {% endif %} diff --git a/scipost/templatetags/user_groups.py b/scipost/templatetags/user_groups.py index 8cd171deae8df806f99faa01f15ed397457ab72e..21a1f0ff5f5db9656c5c2a68cfec6eb6641bb5eb 100644 --- a/scipost/templatetags/user_groups.py +++ b/scipost/templatetags/user_groups.py @@ -12,6 +12,93 @@ def is_edcol_admin(user): return user.groups.filter(name='Editorial Administrators').exists() or user.is_superuser +@register.simple_tag +def is_scipost_admin(user): + """ + Assign template variable (boolean) to check if user is SciPost Administrator. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='SciPost Administrators').exists() or user.is_superuser + + +@register.simple_tag +def is_editorial_college(user): + """ + Assign template variable (boolean) to check if user is member of Editorial College group. + + !!! + This filter should actually be dynamic, not checking the permissions group but the current + active Fellowship instances for the user. + !!! + + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Editorial College').exists() or user.is_superuser + + +@register.simple_tag +def is_advisory_board(user): + """ + Assign template variable (boolean) to check if user is in Advisory Board. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Advisory Board').exists() or user.is_superuser + + +@register.simple_tag +def is_vetting_editor(user): + """ + Assign template variable (boolean) to check if user is in Vetting Editor. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Vetting Editors').exists() or user.is_superuser + + +@register.simple_tag +def is_ambassador(user): + """ + Assign template variable (boolean) to check if user is Ambassador. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Ambassadors').exists() or user.is_superuser + + +@register.simple_tag +def is_junior_ambassador(user): + """ + Assign template variable (boolean) to check if user is Junior Ambassador. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Junior Ambassadors').exists() or user.is_superuser + + +@register.simple_tag +def is_registered_contributor(user): + """ + Assign template variable (boolean) to check if user is Registered Contributor. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Registered Contributors').exists() or user.is_superuser + + +@register.simple_tag +def is_tester(user): + """ + Assign template variable (boolean) to check if user is Tester. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Testers').exists() or user.is_superuser + + +@register.simple_tag +def is_production_officer(user): + """ + Assign template variable (boolean) to check if user is Production Officer. + This assignment is limited to a certain context block! + """ + return user.groups.filter(name='Production Officers').exists() or user.is_superuser + + @register.simple_tag def is_editor_in_charge(user, submission): """ diff --git a/scipost/views.py b/scipost/views.py index fb5ff5b6cf000087a8bf638593772d59fea71478..9b222806a95855071b71a348e0b44614e44c1699 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -719,7 +719,6 @@ def personal_page(request): context['needs_validation'] = contributor.status != CONTRIBUTOR_NORMAL except Contributor.DoesNotExist: contributor = None - context['user_groups'] = request.user.groups.values_list('name', flat=True) if contributor: # Compile the unavailability periods: diff --git a/submissions/models.py b/submissions/models.py index d03e96c2888af6a9592e40ed7c6bc30106b5b2d2..fdacfc9f99876b495e2ec5835d4ffed5a0468c13 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -29,11 +29,13 @@ from journals.constants import SCIPOST_JOURNALS_SUBMIT, SCIPOST_JOURNALS_DOMAINS from journals.models import Publication -############### -# Submissions: -############### class Submission(models.Model): - # Main submission fields + """ + Submission is a SciPost register of an ArXiv article. This object is the central + instance for every action, recommendation, communication, etc. etc. that is related to the + refereeing cycle of a Submission. A possible Publication object is later directly related + to this Submission instance. + """ author_comments = models.TextField(blank=True) author_list = models.CharField(max_length=1000, verbose_name="author list") discipline = models.CharField(max_length=20, choices=SCIPOST_DISCIPLINES, default='physics') @@ -53,7 +55,7 @@ class Submission(models.Model): models.CharField(max_length=10, choices=SCIPOST_SUBJECT_AREAS), blank=True, null=True) - # Status set by Editors + # Refereeing fields status = models.CharField(max_length=30, choices=SUBMISSION_STATUS, default=STATUS_UNASSIGNED) refereeing_cycle = models.CharField(max_length=30, choices=SUBMISSION_CYCLES, default=CYCLE_DEFAULT) @@ -107,6 +109,9 @@ class Submission(models.Model): objects = SubmissionQuerySet.as_manager() + class Meta: + app_label = 'submissions' + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._update_cycle() @@ -129,8 +134,8 @@ class Submission(models.Model): else: header += ' (deprecated version ' + str(self.arxiv_vn_nr) + ')' try: - header += ' (published as %s (%s))' % (self.publication.doi_string, - self.publication.publication_date.strftime('%Y')) + header += ' (published as %s (%s))' % ( + self.publication.doi_string, self.publication.publication_date.strftime('%Y')) except Publication.DoesNotExist: pass return header @@ -274,9 +279,15 @@ class SubmissionEvent(SubmissionRelatedObjectMixin, TimeStampedModel): ###################### class EditorialAssignment(SubmissionRelatedObjectMixin, models.Model): + """ + EditorialAssignment is a registration for Fellows of their duties of being a + Editor-in-charge for a specific Submission. This model could start as a invitation only, + which should then be accepted or declined by the invited. + """ submission = models.ForeignKey('submissions.Submission', on_delete=models.CASCADE) to = models.ForeignKey('scipost.Contributor', on_delete=models.CASCADE) accepted = models.NullBooleanField(choices=ASSIGNMENT_NULLBOOL, default=None) + # attribute `deprecated' becomes True if another Fellow becomes Editor-in-charge deprecated = models.BooleanField(default=False) completed = models.BooleanField(default=False) @@ -477,17 +488,16 @@ class Report(SubmissionRelatedObjectMixin, models.Model): Check if current Report is a `FollowupReport`. A Report is a `FollowupReport` if the author of the report already has a vetted report in the series of the specific Submission. """ - return (self.author.reports.accepted() - .filter(submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr, - submission__arxiv_vn_nr__lt=self.submission.arxiv_vn_nr) - .exists()) + return (self.author.reports.accepted().filter( + submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr, + submission__arxiv_vn_nr__lt=self.submission.arxiv_vn_nr).exists()) def latest_report_from_series(self): """ Get latest Report from the same author for the Submission series. """ - return (self.author.reports.accepted() - .filter(submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr) + return (self.author.reports.accepted().filter( + submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr) .order_by('submission__arxiv_identifier_wo_vn_nr').last()) @@ -520,12 +530,12 @@ class EditorialCommunication(SubmissionRelatedObjectMixin, models.Model): return output -############################ -# Editorial Recommendation # -############################ - -# From the Editor-in-charge of a Submission class EICRecommendation(SubmissionRelatedObjectMixin, models.Model): + """ + The EICRecommendation is the recommendation of a Submission written by + the Editor-in-charge made at the end of the refereeing cycle. It can be voted for by + a subset of Fellows and should contain the actual publication decision. + """ submission = models.ForeignKey('submissions.Submission', on_delete=models.CASCADE, related_name='eicrecommendations') date_submitted = models.DateTimeField('date submitted', default=timezone.now) @@ -574,7 +584,10 @@ class EICRecommendation(SubmissionRelatedObjectMixin, models.Model): class iThenticateReport(TimeStampedModel): - # is_pending = models.BooleanField(default=True) + """ + iThenticateReport is the SciPost register of an iThenticate report. It saves + basic information coming from iThenticate into the SciPost database for easy access. + """ uploaded_time = models.DateTimeField(null=True, blank=True) processed_time = models.DateTimeField(null=True, blank=True) doc_id = models.IntegerField(primary_key=True)