refactor sync and sync_one methods of accession - #532
Conversation
ad63501 to
cd2d8c5
Compare
joefutrelle
left a comment
There was a problem hiding this comment.
Looks like some renaming introduced collisions here, but I'm not sure. If so, the sync_bin endpoint could be affected.
| def _find_ifcb_bin(self, pid): | ||
| for directory in self.dataset.directories.filter(kind=DataDirectory.RAW).order_by('priority'): | ||
| # skip and continue searching | ||
| if not os.path.exists(dd.path): |
There was a problem hiding this comment.
undefined variable dd?
There was a problem hiding this comment.
This was a typo and is now fixed
|
|
||
| directory = ifcb.DataDirectory(directory.path) | ||
| try: | ||
| return directory[pid], directory |
There was a problem hiding this comment.
line 19 swaps a DataDirectory (model instance) for an ifcb.DataDirectory which is a different type of object, and then passes that ifcb.DataDirectory back to code that expects the model instance. That seems like it wouldn't work.
There was a problem hiding this comment.
Good catch. This led to a few places where a pair of (ifcb_bin, ifcb_directory) being used instead of (ifcb_bin, directory) which was needed. The ifcb_ prefix indicates a model from the pyifcb library and with out it the Django model. All of those inconsistencies have now been resolved and I was able to confirm both sync() and sync_one() are now working as expected
cd2d8c5 to
a80053c
Compare
No description provided.