diff options
author | Javier Hernandez <jhernandez@soleta.eu> | 2024-01-24 09:50:14 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-01-24 10:11:06 +0100 |
commit | 55433f3d0069a6e12078a8fe2e1f1d5349b22e17 (patch) | |
tree | c911c0e87ce3117732dddacb27939a9b55c5cec4 | |
parent | ef46aa05998a7477c0aec5ff5e32bc613d113109 (diff) |
views: do not use '_' variable, it causes conflict with babel gettext()
Do not use the '_' variable, this causes a conflict with babel gettext() alias
'_' that results in a traceback.
-rw-r--r-- | ogcp/views.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index a0dface..0fd085c 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -27,7 +27,7 @@ from ogcp.models import User from ogcp.forms.auth import LoginForm, UserForm, DeleteUserForm from ogcp.og_server import OGServer, servers from flask_babel import lazy_gettext as _l -from flask_babel import _ +from flask_babel import gettext, _ from ogcp import app, ogcp_cfg_path import requests import datetime @@ -515,7 +515,7 @@ def action_setup_select(): client_choices.append((ip, f"{client_name} ({ip})")) form.selected_client.choices = client_choices - scopes, _ = get_scopes(ips) + scopes, unused = get_scopes(ips) selected_clients = list(get_selected_clients(scopes['scope']).items()) return render_template('actions/select_client.html', @@ -560,7 +560,7 @@ def action_setup_show(): # Make form.partition length equal to (filtered_partitions - 1) length diff = len(filtered_partitions) - 1 - len(form.partitions) - [form.partitions.append_entry() for _ in range(diff)] + [form.partitions.append_entry() for unused in range(diff)] for partition, db_part in zip(form.partitions, filtered_partitions[1:]): partition.partition.data = str(db_part['partition']) @@ -1082,7 +1082,7 @@ def action_folder_delete(): form.server.data = params['scope-server'] form.submit.render_kw = {"formaction": url_for('action_folder_delete')} - scopes, _ = get_scopes() + scopes, unused = get_scopes() folder = find_folder(int(folder_id), scopes) if not folder: flash(('Folder was not found'), category='info') @@ -1112,7 +1112,7 @@ def action_folder_add(): form.room.data = room form.center.data = center form.submit.render_kw = {"formaction": url_for('action_folder_add_post')} - scopes, _ = get_scopes() + scopes, unused = get_scopes() return render_template('actions/folder_add.html', form=form, parent="scopes.html", scopes=scopes) |