Commit a67e81b Fix showing the project overview if head is undefined, assume `master` then

1 file Authored and Committed by pingou 2 months ago
Fix showing the project overview if head is undefined, assume `master` then

If `head` is undefined, the ajax request listing the branches available
for PRs will fail because the `branch_to` argument will be `None` and
thus ignored while it's actually required. So instead of bailing out
just assume the head is `master`, the rest of the code should know how
to deal with this.

Fixes https://pagure.io/pagure/issue/3305

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

    
 1 @@ -407,7 +407,7 @@
 2   </script>
 3   <script>
 4   
 5 - {% if g.authenticated and not g.repo_obj.is_empty%}
 6 + {% if g.authenticated and not g.repo_obj.is_empty %}
 7   $(function() {
 8     $.ajax({
 9       url: '{{ url_for("internal_ns.get_pull_request_ready_branch") }}' ,
10 @@ -433,7 +433,7 @@
11               repo=repo.name,
12               username=g.fas_user.username,
13               namespace=repo.namespace,
14 -             branch_to=head,
15 +             branch_to=head or 'master',
16               branch_from='') }}" + branch;
17             html = '<a class="dropdown-item" \
18             href="' + url + '">From <span class="badge badge-secondary" style="font-size:0.9em;">'