Commit 297ac387 authored by Mattia Rizzolo's avatar Mattia Rizzolo

Prevent some YAMLLoadWarning by using safe_load() instead of load()

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent 82131a0b
...@@ -149,7 +149,7 @@ class Permissions: ...@@ -149,7 +149,7 @@ class Permissions:
def __init__(self): def __init__(self):
raw = pkg_resources.resource_string("uitwww", "data/permissions.yml") raw = pkg_resources.resource_string("uitwww", "data/permissions.yml")
self.config = yaml.load(raw.decode("utf-8")) self.config = yaml.safe_load(raw.decode("utf-8"))
def allowed_teams(self): def allowed_teams(self):
"""Return a list of teams allowed to log in""" """Return a list of teams allowed to log in"""
......
...@@ -56,7 +56,7 @@ class Navbar: ...@@ -56,7 +56,7 @@ class Navbar:
def install(self, app): def install(self, app):
"""Install this navbar on the app""" """Install this navbar on the app"""
raw = pkg_resources.resource_string("uitwww", "data/navbar.yml") raw = pkg_resources.resource_string("uitwww", "data/navbar.yml")
config = yaml.load(raw.decode("utf-8")) config = yaml.safe_load(raw.decode("utf-8"))
self._prepare_navbar_cache(config, []) self._prepare_navbar_cache(config, [])
# Add the _navbars variable to the templates # Add the _navbars variable to the templates
......
...@@ -23,7 +23,7 @@ import hashlib ...@@ -23,7 +23,7 @@ import hashlib
def prepare_blueprint(app): def prepare_blueprint(app):
"""Prepare a blueprint containing all the redirects""" """Prepare a blueprint containing all the redirects"""
raw = pkg_resources.resource_string("uitwww", "data/redirects.yml") raw = pkg_resources.resource_string("uitwww", "data/redirects.yml")
config = yaml.load(raw.decode("utf-8")) config = yaml.safe_load(raw.decode("utf-8"))
bp = flask.Blueprint("redirects", __name__) bp = flask.Blueprint("redirects", __name__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment