#3821 Allow users to update PR's metadata when the PR is closed
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

@@ -452,7 +452,7 @@ 

      <div class="mb-4">

          <h5 class="d-flex align-items-center font-weight-bold border-bottom">

            <div class="py-2 text-uppercase font-size-09">Metadata</div>

-           {% if g.authenticated and mergeform and pull_request.status == 'Open'

+           {% if g.authenticated and mergeform

            and (g.repo_committer

                or g.fas_user.username == pull_request.user.user) %}

            <div class="ml-auto">
@@ -461,8 +461,7 @@ 

            </div>

          {% endif %}

          </h5>

-         {% if g.authenticated and mergeform and pull_request.status == 'Open'

-             and g.repo_committer %}

+         {% if g.authenticated and mergeform and g.repo_committer %}

            <form method="POST" action="{{ url_for('ui_ns.update_pull_requests',

                repo=repo.name,

                username=username,
@@ -521,10 +520,9 @@ 

            {% endif %}

          </fieldset>

  

-         {% if g.authenticated and mergeform and pull_request.status == 'Open'

+         {% if g.authenticated and mergeform

                  and (g.repo_committer

                      or g.fas_user.username == pull_request.user.user) %}

- 

                <input type="submit" class="btn btn-primary issue-metadata-form hidden" value="Update">

              </form>

          {% endif %}

file modified
-3
@@ -1281,9 +1281,6 @@ 

      if not request:

          flask.abort(404, "Pull-request not found")

  

-     if request.status != "Open":

-         flask.abort(403, "Pull-request closed")

- 

      if (

          not flask.g.repo_committer

          and flask.g.fas_user.username != request.user.username

@@ -1743,7 +1743,7 @@ 

              output = self.app.post(

                  '/test/pull-request/1/update', data=data,

                  follow_redirects=True)

-             self.assertEqual(output.status_code, 403)

+             self.assertEqual(output.status_code, 200)

  

              # Project w/o pull-request

              repo = pagure.lib.get_authorized_project(self.session, 'test')
@@ -1883,7 +1883,7 @@ 

              output = self.app.post(

                  '/test/pull-request/1/update', data=data,

                  follow_redirects=True)

-             self.assertEqual(output.status_code, 403)

+             self.assertEqual(output.status_code, 200)

  

              # Project w/o pull-request

              repo = pagure.lib.get_authorized_project(self.session, 'test')