generated from thclark/django-rabid-armadillo
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Bug report
What is the current behavior?
If the current behavior is a bug, please provide any stack traces the steps reproduce and, if possible, a minimal demo of the problem.
Django model inheriting from AbstractSynchronisedDatastore throws a ConsistencyError while adding a new file (instance creation).
What is the expected behavior?
Adding a new file using the modal doesn't raise exception.
Other information
Explicitly passing the id to Datafile when update_from_store is False In AbstractSynchronisedDatastore seems to solve this for me.
django-twined/django_twined/models/datastores.py
Lines 107 to 112 in 016a28c
| df = Datafile( | |
| path, | |
| ignore_stored_metadata=False, | |
| tags=self.get_tags_from_instance(), | |
| labels=self.get_labels_from_instance(), | |
| ) |
def to_datafile(self, update_from_store=True, allow_no_location=False):
...
if update_from_store:
df = Datafile(path)
else:
df = Datafile(
path,
id=str(self.id), # <-- set the id; idk if this has implications in use cases other than on instance creation
ignore_stored_metadata=False,
tags=self.get_tags_from_instance(),
labels=self.get_labels_from_instance(),
)Or maybe add a create_new_instance=False kwarg and create datafile with this.id as the id when called from AbstractSynchronisedDatastore.save method.
Metadata
Metadata
Assignees
Labels
No labels