Skip to content
Snippets Groups Projects
Commit c32b5899 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: allow empty records in cfood

parent 5b7a0dfe
No related branches found
No related tags found
2 merge requests!160STY: styling,!132Allow empty records
Pipeline #40982 passed with warnings
......@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ###
### Fixed ###
- Empty Records can now be created (https://gitlab.com/caosdb/caosdb-crawler/-/issues/27)
### Security ###
......
......@@ -235,6 +235,12 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict
keys_modified = []
for name, record in def_records.items():
# If only a name was given (Like this:
# Experiment:
# ) set record to an empty dict / empty configuration
if record is None:
record = {}
role = "Record"
# This allows us to create e.g. Files
if "role" in record:
......
......@@ -10,7 +10,6 @@ data:
match_name: '.*'
records:
Experiment:
name: "e"
Projekt:
parents: ["project"]
name: "p"
......@@ -25,6 +24,7 @@ data:
records:
Experiment:
parents: ["Exp"]
name: "e"
Projekt:
parents: ["Projekt"]
Campaign:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment