neurocurator
neurocurator copied to clipboard
[Annotations] Adding Parameters to Annotations with no tags crashes
Steps:
- Create a new annotation, without adding any tag.
- Create a new parameter (e.g., age).
- Try to save. It should fail and produce the following stack trace.
Stack trace:
Traceback (most recent call last):
File "/home/oreilly/GIT_repos/neurocurator/neurocurator/modParamWidgets.py", line 317, in saveParameter
relationship = self.relationWgt.getRelationship()
File "/home/oreilly/GIT_repos/neurocurator/neurocurator/paramRelationWgt.py", line 128, in getRelationship
return Relationship(self.relationshipCbo.currentText(), tag1, tag2)
UnboundLocalError: local variable 'tag1' referenced before assignment
What was the reference ID?
I wasn't able to reproduce this behaviour with NeuroCurator v0.4.0 (packaged) and the following steps:
- In tab References, double-click on the reference of ID PMID_7965855.
- In Annotations details, click on New.
- Select 'table' in Annotation type.
- Enter '1' in Table no., Row no. and Column_no..
- Click on Save.
- Click on the annotation in Listing of existing annotations.
- Click on Parameters on the right panel.
- Click on New.
- Select 'age' for Parameter in Parameter details.
- Enter '3' in Values and 'week' in Unit.
- Click on Save in Existing parameters.
- No stack trace.
The issue appears when Relationship in Parameter details has a value different from 'unspecified' ('point', 'directed', 'undirected').
When creating a new parameter, it is possible that Relationship has already a value different from 'unspecified' because of #35: the value comes from the previous selected parameter.