fix(python): use creds to determine account links to display

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-12-04 00:15:34 -08:00
parent d0fc56d53f
commit 973dbf0482
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -69,20 +69,24 @@
| safe | safe
}} }}
</li> </li>
<li> {% if request.user.has_credential(creds.ACCOUNT_EDIT, approved=[user]) %}
{{ "%sEdit this user's account%s" <li>
| tr {{ "%sEdit this user's account%s"
| format('<a href="/account/%s/edit">' | format(user.Username), "</a>") | tr
| safe | format('<a href="/account/%s/edit">' | format(user.Username), "</a>")
}} | safe
</li> }}
<li> </li>
{{ "%sList this user's comments%s" {% endif %}
| tr {% if request.user.has_credential(creds.ACCOUNT_LIST_COMMENTS, approved=[user]) %}
| format('<a href="/account/%s/comments">' | format(user.Username), "</a>") <li>
| safe {{ "%sList this user's comments%s"
}} | tr
</li> | format('<a href="/account/%s/comments">' | format(user.Username), "</a>")
| safe
}}
</li>
{% endif %}
</ul> </ul>
</td> </td>
</tr> </tr>