Skip to content

Conversation

@mankind
Copy link

@mankind mankind commented Jul 5, 2016

Fix for issue #47. The problem is triggered in the row_importer class by this line of code object.can_overwrite(@batch_id, @overwrite_batch_id) when we call attempt_to_overwrite!(object) method, Instead of using object.batch_id, it is using batch_id which results in an attempt to create a new plot in the database using the records of a plot that already exists. That in turn causes the reported error: No permission to override Plot a different batch

The way the code is currently designed, it will always create a new batch in the database each time an upload is submitted irrespective of whether it is a new upload or simply an update which was the case with Allie. I didn't want to change that, so I added a new boolean column named duplicate to the batches table. This will allow us to easily delete duplicate batch record that was created during update but are redundant. In order to fix the reported issue, I had to reuse existing batch whenever an import is an update as Allie was doing, So the boolean duplicate column allows us to set any new batch record* created during an up date to true and later we can just delete all batch record where the duplicate value is equal to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant