#3316 Fix showing the project overview if head is undefined
Merged 6 years ago by pingou. Opened 6 years ago by pingou.

@@ -407,7 +407,7 @@ 

  </script>

  <script>

  

- {% if g.authenticated and not g.repo_obj.is_empty%}

+ {% if g.authenticated and not g.repo_obj.is_empty %}

  $(function() {

    $.ajax({

      url: '{{ url_for("internal_ns.get_pull_request_ready_branch") }}' ,
@@ -433,7 +433,7 @@ 

              repo=repo.name,

              username=g.fas_user.username,

              namespace=repo.namespace,

-             branch_to=head,

+             branch_to=head or 'master',

              branch_from='') }}" + branch;

            html = '<a class="dropdown-item" \

            href="' + url + '">From <span class="badge badge-secondary" style="font-size:0.9em;">'

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.

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

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

rebased onto 5baca220eefea36855310b99ff4f566c24e6344c

6 years ago

rebased onto a67e81b

6 years ago

Thanks for the review!

Pull-Request has been merged by pingou

6 years ago