Browse Source

Mark some Topic API properties as nonnull

voted, bookmarked, and ignored cannot be None.
see TopicQuery._process_result() in tildes/models/topic/topic_query.py
merge-requests/167/head
Andrew Shu 2 months ago
committed by talklittle
parent
commit
f7e1d4f294
  1. 3
      tildes/openapi_beta.yaml
  2. 2
      tildes/tildes/models/topic/topic_query.py

3
tildes/openapi_beta.yaml

@ -316,13 +316,10 @@ components:
nullable: true
voted:
type: boolean
nullable: true
bookmarked:
type: boolean
nullable: true
ignored:
type: boolean
nullable: true
official:
type: boolean
tags:

2
tildes/tildes/models/topic/topic_query.py

@ -142,7 +142,7 @@ class TopicQuery(PaginatedQuery):
topic.bookmark_created_time = None
topic.last_visit_time = None
topic.comments_since_last_visit = None
topic.user_bookmarked = None
topic.user_bookmarked = False
topic.user_ignored = False
else:
topic = result.Topic

Loading…
Cancel
Save