diff --git a/pagure/__init__.py b/pagure/__init__.py index ceb0a06..f9873b5 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -56,7 +56,7 @@ if APP.config.get('THEME_TEMPLATE_FOLDER', False): # That's what we do here template_folder = APP.config['THEME_TEMPLATE_FOLDER'] if template_folder[0] != '/': - template_folder= os.path.join( + template_folder = os.path.join( APP.root_path, APP.template_folder, template_folder) import jinja2 # Jinja looks for the template in the order of the folders specified @@ -70,7 +70,7 @@ if APP.config.get('THEME_TEMPLATE_FOLDER', False): if APP.config.get('THEME_STATIC_FOLDER', False): static_folder = APP.config['THEME_STATIC_FOLDER'] if static_folder[0] != '/': - static_folder= os.path.join( + static_folder = os.path.join( APP.root_path, 'static', static_folder) # Unlike templates, to serve static files from multiples folders we # need flask-multistatic @@ -87,7 +87,7 @@ class RepoConverter(BaseConverter): :param map: the :class:`Map`. """ regex = r'[^/]*(/[^/]+)?' - #weight = 200 + # weight = 200 APP.url_map.converters['repo'] = RepoConverter @@ -418,7 +418,8 @@ def auth_login(): # pragma: no cover if not APP.config.get('ENABLE_GROUP_MNGT', False): groups = [ group.group_name - for group in pagure.lib.search_groups(SESSION, group_type='user') + for group in pagure.lib.search_groups( + SESSION, group_type='user') ] groups = set(groups).union(admins) return FAS.login(return_url=return_point, groups=groups) diff --git a/pagure/default_config.py b/pagure/default_config.py index d9a497c..246d8df 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -221,8 +221,10 @@ ACLS = { } # Bootstrap URLS -BOOTSTRAP_URLS_CSS = 'https://apps.fedoraproject.org/global/fedora-bootstrap-1.0.1/fedora-bootstrap.css' -BOOTSTRAP_URLS_JS = 'https://apps.fedoraproject.org/global/fedora-bootstrap-1.0.1/fedora-bootstrap.js' +BOOTSTRAP_URLS_CSS = 'https://apps.fedoraproject.org/global/' \ + 'fedora-bootstrap-1.0.1/fedora-bootstrap.css' +BOOTSTRAP_URLS_JS = 'https://apps.fedoraproject.org/global/' \ + 'fedora-bootstrap-1.0.1/fedora-bootstrap.js' # List of the type of CI service supported by this pagure instance PAGURE_CI_SERVICES = [] diff --git a/pagure/docs_server.py b/pagure/docs_server.py index dad385e..d2b5263 100644 --- a/pagure/docs_server.py +++ b/pagure/docs_server.py @@ -135,7 +135,6 @@ def view_docs(repo, username=None, filename=None): repo_obj = pygit2.Repository(reponame) - if not repo_obj.is_empty: commit = repo_obj[repo_obj.head.target] else: diff --git a/pagure/forms.py b/pagure/forms.py index e23598b..cff4e58 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -30,14 +30,15 @@ def file_virus_validator(form, field): return from pyclamd import ClamdUnixSocket - if not field.name in flask.request.files or \ + if field.name not in flask.request.files or \ flask.request.files[field.name].filename == '': # If no file was uploaded, this field is correct return uploaded = flask.request.files[field.name] clam = ClamdUnixSocket() if not clam.ping(): - raise wtforms.ValidationError('Unable to communicate with virus scanner') + raise wtforms.ValidationError( + 'Unable to communicate with virus scanner') results = clam.scan_stream(uploaded.stream.read()) if results is None: uploaded.stream.seek(0) @@ -457,6 +458,7 @@ class DefaultBranchForm(wtf.Form): (branch, branch) for branch in kwargs['branches'] ] + class EditCommentForm(wtf.Form): """ Form to verify that comment is not empty """