Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123961
D4063.id14371.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
921 B
Subscribers
None
D4063.id14371.diff
View Options
diff --git a/swh/deposit/api/checks.py b/swh/deposit/api/checks.py
--- a/swh/deposit/api/checks.py
+++ b/swh/deposit/api/checks.py
@@ -3,6 +3,14 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
+"""Functional Metadata checks:
+
+Mandatory fields:
+- 'author'
+- 'name' or 'title'
+
+"""
+
from typing import Dict, Optional, Tuple
MANDATORY_FIELDS_MISSING = "Mandatory fields are missing"
@@ -20,12 +28,13 @@
ok (False, <detailed-error>) otherwise.
"""
+ # following fields are mandatory
required_fields = {
"author": False,
}
+ # at least one value per couple below is mandatory
alternate_fields = {
- ("name", "title"): False, # alternate field, at least one
- # of them must be present
+ ("name", "title"): False,
}
for field, value in metadata.items():
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 20 2024, 7:16 AM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3224551
Attached To
D4063: deposit.api.checks: Add docstring to module
Event Timeline
Log In to Comment