Skip to content
Snippets Groups Projects
Unverified Commit d71f1d72 authored by Martijn Braam's avatar Martijn Braam
Browse files

Don't list contents unless there's a query

parent eb4d881c
No related branches found
No related tags found
No related merge requests found
......@@ -429,11 +429,15 @@ def contents():
repos = get_repos()
offset = (form['page'] - 1) * 50
if form['name'] == '' and form['file'] == '' and form['path'] == '':
contents = []
num_contents = 0
else:
contents = get_contents(branch=form['branch'], offset=offset, file=file, path=path, name=name, arch=arch,
repo=form['repo'])
contents = get_contents(branch=form['branch'], offset=offset, file=file, path=path, name=name, arch=arch,
repo=form['repo'])
num_contents = get_num_contents(branch=form['branch'], file=file, path=path, name=name, arch=arch, repo=repo)
num_contents = get_num_contents(branch=form['branch'], file=file, path=path, name=name, arch=arch, repo=repo)
pages = ceil(num_contents / 50)
pag_start = form['page'] - 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment