This new description may be edited by the site staff by visiting /admin/prizes/competitionprize/{prize-id}/change and editing the prize_attribution_template field. This field is rendered by the API as if it were a django template. It has the following context variables available:
rank: The rank of the user in the competition;
score: The score of the user in all of the competition's criteria
Example:
If the prize's prize_attribution_template is set to Congratulations, you got {{ rank|ordinal }} place. You score was {{ score }}, the API will later render it as Congratulations, you got 1st place. You score was saved CO2 emissions: 404.143
This PR adds a new attribute to the representation sent to requests of
/api/my-competitions-won/
.The attribute is called
winner_description
and it shows a description for the message that can be shown for each of the prizes won by the user.Example response:
This new description may be edited by the site staff by visiting
/admin/prizes/competitionprize/{prize-id}/change
and editing theprize_attribution_template
field. This field is rendered by the API as if it were a django template. It has the following context variables available:Example:
If the prize's
prize_attribution_template
is set toCongratulations, you got {{ rank|ordinal }} place. You score was {{ score }}
, the API will later render it asCongratulations, you got 1st place. You score was saved CO2 emissions: 404.143