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 4 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 nullable: true
voted: voted:
type: boolean type: boolean
nullable: true
bookmarked: bookmarked:
type: boolean type: boolean
nullable: true
ignored: ignored:
type: boolean type: boolean
nullable: true
official: official:
type: boolean type: boolean
tags: tags:

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

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

Loading…
Cancel
Save