Render user display names in trophy messages
Review Request #1251 — Created May 31, 2018 and submitted
Information | |
---|---|
guest1387 | |
Review Board | |
Reviewers | |
guest1387 |
Trophy message rendering has been reworked. Instead of a method that every `TrophyType` subclass must implement, instead they must only add a format string attribute. By default, the recipient's name is the only provided parameter, but `TrophyType.format_display_text` can be overridden to add extra context. All builtin trophies have been updated to use this new behaviour. Testing Done: Ran unit tests. Reviewed at https://reviews.reviewboard.org/r/9932/
When it fails it is consider done!
Description | From | Last Updated |
---|---|---|
It needs MORE COW BELL! |
|
|
It needs more cow bell! |
|
|
Needs more cow bell! |
|
|
cool |
|
|
def get_display_text(self, trophy): return 'A trophy for you.!' |
|
|
Nice! |
|
|
Cool! |
|
|
Cool |
|
|
Can this be written more beutiful!! |
|
-
-
-
reviewboard/accounts/tests.py (Diff revision 1) def get_display_text(self, trophy):
return 'A trophy for you.!' -