MA-2050: add optional user profile details in GET thread & comment
This commit is contained in:
@@ -51,6 +51,7 @@ class ThreadListGetForm(_PaginationForm):
|
||||
choices=[(choice, choice) for choice in ["asc", "desc"]],
|
||||
required=False
|
||||
)
|
||||
requested_fields = MultiValueField(required=False)
|
||||
|
||||
def clean_order_by(self):
|
||||
"""Return a default choice"""
|
||||
@@ -106,6 +107,7 @@ class CommentListGetForm(_PaginationForm):
|
||||
"""
|
||||
thread_id = CharField()
|
||||
endorsed = ExtendedNullBooleanField(required=False)
|
||||
requested_fields = MultiValueField(required=False)
|
||||
|
||||
|
||||
class CommentActionsForm(Form):
|
||||
@@ -115,3 +117,10 @@ class CommentActionsForm(Form):
|
||||
"""
|
||||
voted = BooleanField(required=False)
|
||||
abuse_flagged = BooleanField(required=False)
|
||||
|
||||
|
||||
class CommentGetForm(_PaginationForm):
|
||||
"""
|
||||
A form to validate query parameters in the comment retrieval endpoint
|
||||
"""
|
||||
requested_fields = MultiValueField(required=False)
|
||||
|
||||
Reference in New Issue
Block a user