{% 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.

Syntax

{% set_profile
attribute:value
 
Include one or more attributes to set.
...
%}

You may also include reference variables as properties, which will be dereferenced to their property names before setting the user properties.

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 %}