prjemian / assign_gup

Assist in assigning APS GUPs to PRP members
http://assign_gup.readthedocs.io
0 stars 1 forks source link

import proposals fails with ValueError #69

Closed prjemian closed 7 years ago

prjemian commented 7 years ago

When importing an XML file with new or revised list of proposals, this exception was raised:

(15684,Assign_GUP,2017-03-07 10:43:19.749000) Opening PRP file: C:/Users/Pete/Desktop/2017-2_WithReviewers.agup
(15684,Assign_GUP,2017-03-07 10:43:19.833000) Open PRP file: C:/Users/Pete/Desktop/2017-2_WithReviewers.agup
(15684,Assign_GUP,2017-03-07 10:43:19.835000) selected PRP file: C:/Users/Pete/Desktop/2017-2_WithReviewers.agup
(15684,Assign_GUP,2017-03-07 10:43:30.107000) Traceback (most recent call last):
(15684,Assign_GUP,2017-03-07 10:43:30.107000)   File "d:\apps\anaconda\lib\site-packages\Assign_GUP\main_window.py", line 420, in importProposals
(15684,Assign_GUP,2017-03-07 10:43:30.107000)     self.agup.importProposals(filename)
(15684,Assign_GUP,2017-03-07 10:43:30.107000)   File "d:\apps\anaconda\lib\site-packages\Assign_GUP\agup_data.py", line 109, in importProposals
(15684,Assign_GUP,2017-03-07 10:43:30.123000)     self._restore_assignments(props)
(15684,Assign_GUP,2017-03-07 10:43:30.123000)   File "d:\apps\anaconda\lib\site-packages\Assign_GUP\agup_data.py", line 174, in _restore_assignments
(15684,Assign_GUP,2017-03-07 10:43:30.123000)     raise ValueError, msg
(15684,Assign_GUP,2017-03-07 10:43:30.123000) ValueError: Reviewer "Reviewer Name" assigned to proposal "abcde" is not on the list of reviewers for that proposal
(15684,Assign_GUP,2017-03-07 10:44:52.460000) imported Proposals from: C:/Users/Pete/Desktop/2017-2_raw_rev1.xml
(15684,Assign_GUP,2017-03-07 10:44:52.461000) imported proposals file: C:/Users/Pete/Desktop/2017-2_raw_rev1.xml

The problem is that reviewer "Reviewer Name" was assigned to this proposal in file 2017-2_WithReviewers.agup while this same reviewer name was not available in the imported file 2017-2_raw_rev1.xml. In addition, other reviewers were assigned to this proposal in the new XML file.

This needs to be resolved with an additional dialog box presenting a decision for the user to make as to how to handle this.

prjemian commented 7 years ago

In this case, since the reviewer assigned in the .agup file is not listed in the newer .xml file, the decision is simpler. Remove the assignment to "Reviewer Name" and apply any assignments from the new XML file. The new reviewer(s) must be in the allowed list or the allowed list must also be revised.

Overall, the "Import topics", "Import reviewers", and "Import proposals" menu items should be combined into one, with check boxes for each of these. From a single dialog, the user can decide the scope of what will be accepted for import.

prjemian commented 7 years ago

Did not add new dialog as mentioned, leaving that work for #70 so the bugfix could be pushed out today.