#353 Lets a PR submitter close PR
Closed by pingou. Opened by dhrish20.
dhrish20/pagure issue296  into  master

Download 353.patch
no initial comment

With this change, anyone will be able to close the pull-request, while we want only admins or the person that opened the pull-request. So we need more than this :)

So the later part of this line check if repo_admin is True or if pull_request.user.user is something (ie: not None or not False or not [] or not {}...). So in this case, pull_request.user.user will always be valid as there will always be someone that opened the pull-request.

The second part of this check, only ensure that the user is logged in basically.
It doesn't check if the user that is logged in is the one who opened the PR.

@dhrish20 do you need help with this one?

@pingou yes i need some help on this.

So where are you stuck? Do you know how to fix one or the other of my comments?

I am not able to understand that how do we check that "this particular user is the pull request assignee" .

"repo_admin" determines the admin of the repo.
"issue.assignee" determines the person who has assigned the issue to himself/herself.

There is "pull_request.assignee.username".

So, should the code be something like this?:

{% if pull_request.status == 'Open' and username=pull_request.assignee.username %}

{% if pull_request.status == 'Open' and username==pull_request.assignee.username %}

username isn't the username that is logged in, g.fas_user.username is though ;-)

So the question is: is the person that is logged in the person that opened the pull-request or not? :)

@pingou Thank you for the hint!

I have made some changes. Could you please take a look at it?

This one still needs to be fixed, the later part not flask.g.fas_user.username is checking if the user logged in has a username

Hi @dhrish20,

Did you see my latest comment?

@pingou. Yes i saw that. But my test is failing, again the same one "test_progit_flask_ui_fork.py"

@pingou. Yes i saw that. But my test is failing, again the same one "test_progit_flask_ui_fork.py"

Which test fails? And is it expected that it fails? :)

If you have a minute, could you drop by on IRC so that we can work this PR directly?

(If I'm not there when you come by, wait for me :))

@dhrish20, I am going to take over this PR and finish it, I would like to have it merged before I make the next release :)

Thanks for your help on this!

Thanks @pingou. Sorry, I am little busy with PyCon India.

No worry and for taking over but I'd like to release soon :)

okay :)

Metadata