Update register.html

This commit is contained in:
augustin64 2023-03-04 19:48:37 +01:00
parent d5a59248ab
commit 46684a0f7e
2 changed files with 5 additions and 1 deletions

View File

@ -68,7 +68,8 @@ def add_user():
# Success, go to the login page. # Success, go to the login page.
user = User(name=username) user = User(name=username)
try: try:
user.join_album(album_uuid) if album_uuid != "":
user.join_album(album_uuid)
flash(f"Utilisateur {username} créé") flash(f"Utilisateur {username} créé")
return redirect("/albums") return redirect("/albums")
except LookupError: except LookupError:

View File

@ -12,6 +12,8 @@
<input type="password" name="password" id="password" required> <input type="password" name="password" id="password" required>
<input type="submit" value="Créer un compte"> <input type="submit" value="Créer un compte">
</form> </form>
{% if g.user.access_level == 1 %}
<!-- Uniquement pour /add-user -->
<label for="album_uuid">Ajouter à un album: </label> <label for="album_uuid">Ajouter à un album: </label>
<select name="album_uuid" id="album_uuid" form="add-user-form"> <select name="album_uuid" id="album_uuid" form="add-user-form">
<option value="">Aucun</option> <option value="">Aucun</option>
@ -19,4 +21,5 @@
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option> <option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
{% endfor %} {% endfor %}
</select> </select>
{% endif %}
{% endblock %} {% endblock %}