Fix "prev_subject" with LEGACY_PREV_TOPIC.

I added `LEGACY_` prefix to the var, because
otherwise you'd have really confusing code
where you change the key from `PREV_TOPIC`
to "prev_topic".
This commit is contained in:
Steve Howell
2018-11-09 16:53:59 +00:00
committed by Tim Abbott
parent a49ba8c577
commit 0a171bf9bf
3 changed files with 12 additions and 7 deletions

View File

@@ -23,9 +23,14 @@ from typing import Any, Dict, List, Tuple
ORIG_TOPIC = "orig_subject"
TOPIC_NAME = "subject"
TOPIC_LINKS = "subject_links"
PREV_TOPIC = "prev_subject"
MATCH_TOPIC = "match_subject"
# This constant is actually embedded into
# the JSON data for message edit history,
# so we'll always need to handle legacy data
# unless we do a pretty tricky migration.
LEGACY_PREV_TOPIC = "prev_subject"
# This is used in low-level message functions in
# zerver/lib/message.py, and it's not user facing.
DB_TOPIC_NAME = "subject"