Set_profile

Set_profile

{% set_profile %}

Saves custom properties on the profile that will be accessible whenever the current profile is logged in. The properties will be saved to the profile's attribute dictionary. Note that this is meaningless unless the user is logged in.

Examples

Set Profile

Copy
{% if submission.is_valid %} {% var bestScoreName = form.name.value | classname | prepend:'bestscore-' %} {% var bestScore = submission.score | to_int %} {% var previousBestScore = profile.attributes[bestScoreName] | to_int %} {% if previousBestScore > bestScore %} {% set bestScore = previousBestScore %} {% endif %} {% set_profile last_score:submission.score &bestScoreName:bestScore %} {% endif %}