Skip to content
Snippets Groups Projects
Commit 988208cd authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-empty' into 'dev'

Allow empty records

See merge request !132
parents 942cf082 369286d6
No related branches found
No related tags found
2 merge requests!160STY: styling,!132Allow empty records
Pipeline #41704 passed
...@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### ### Removed ###
### Fixed ### ### Fixed ###
- Empty Records can now be created (https://gitlab.com/caosdb/caosdb-crawler/-/issues/27)
* [#58](https://gitlab.com/caosdb/caosdb-crawler/-/issues/58) Documentation builds API docs in pipeline now. * [#58](https://gitlab.com/caosdb/caosdb-crawler/-/issues/58) Documentation builds API docs in pipeline now.
......
...@@ -235,6 +235,12 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict ...@@ -235,6 +235,12 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict
keys_modified = [] keys_modified = []
for name, record in def_records.items(): 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" role = "Record"
# This allows us to create e.g. Files # This allows us to create e.g. Files
if "role" in record: if "role" in record:
......
...@@ -10,7 +10,6 @@ data: ...@@ -10,7 +10,6 @@ data:
match_name: '.*' match_name: '.*'
records: records:
Experiment: Experiment:
name: "e"
Projekt: Projekt:
parents: ["project"] parents: ["project"]
name: "p" name: "p"
...@@ -25,6 +24,7 @@ data: ...@@ -25,6 +24,7 @@ data:
records: records:
Experiment: Experiment:
parents: ["Exp"] parents: ["Exp"]
name: "e"
Projekt: Projekt:
parents: ["Projekt"] parents: ["Projekt"]
Campaign: Campaign:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment