Skip to content

Commit 0a5bac7

Browse files
authored
Merge pull request #4990 from nucleogenesis/lft-must-be-int-error-improvement
raise rest_framework.ValidationError when lft is not an integer
2 parents ab12eab + 0a2a718 commit 0a5bac7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

contentcuration/contentcuration/viewsets/contentnode.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,11 @@ def decode_cursor(self, request):
689689
if value is None:
690690
return None
691691

692+
try:
693+
value = int(value)
694+
except ValueError:
695+
raise ValidationError("lft must be an integer but an invalid value was given.")
696+
692697
return Cursor(offset=0, reverse=False, position=value)
693698

694699
def encode_cursor(self, cursor):

0 commit comments

Comments
 (0)