Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9312241
D1862.id6276.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
643 B
Subscribers
None
D1862.id6276.diff
View Options
diff --git a/swh/model/model.py b/swh/model/model.py
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -341,8 +341,10 @@
@length.validator
def check_length(self, attribute, value):
"""Checks the length is positive."""
- if value < 0:
- raise ValueError('Length must be positive.')
+ if self.status == 'absent' and value < -1:
+ raise ValueError('Length must be positive or -1.')
+ elif self.status != 'absent' and value < 0:
+ raise ValueError('Length must be positive, unless status=absent.')
@reason.validator
def check_reason(self, attribute, value):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 2, 10:47 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220729
Attached To
D1862: Allow -1 as Content length.
Event Timeline
Log In to Comment