mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(users.validate): users can't edit their own account types
This commit also decouples testing regarding this feature into several test functions. Signed-off-by: Kevin Morris <kevr@0cost.org> bump Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
c7751d5d63
commit
f357615bfb
3 changed files with 146 additions and 128 deletions
|
@ -43,24 +43,25 @@
|
|||
</p>
|
||||
|
||||
{% if request.user.has_credential(creds.ACCOUNT_CHANGE_TYPE) %}
|
||||
<p>
|
||||
<label for="id_type">
|
||||
{% trans %}Account Type{% endtrans %}:
|
||||
</label>
|
||||
<select name="T" id="id_type">
|
||||
{% for value, type in account_types %}
|
||||
<option value="{{ value }}"
|
||||
{% if request.user.AccountType.ID == value %}
|
||||
selected="selected"
|
||||
{% endif %}
|
||||
>
|
||||
{{ type | tr }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</p>
|
||||
{% if request.user != user %}
|
||||
<p>
|
||||
<label for="id_type">
|
||||
{% trans %}Account Type{% endtrans %}:
|
||||
</label>
|
||||
<select name="T" id="id_type">
|
||||
{% for value, type in account_types %}
|
||||
<option value="{{ value }}"
|
||||
{% if request.user.AccountType.ID == value %}
|
||||
selected="selected"
|
||||
{% endif %}
|
||||
>
|
||||
{{ type | tr }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<label for="id_suspended">
|
||||
{% trans %}Account Suspended{% endtrans %}:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue