self.merge() will actually do the merge server-side, on behalf of the user. We don't want to do that here, just update the status field.
has_access doesn't ever return "None" but it will act like a boolean, so you can just do and has_access(self.req, 'write') and that's it. Also no need to use parantheses around individual expressions like that one and (self.req.creator == c.user). Save them for keeping "and" and "or" expressions grouped properly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Dave.
I added that option so as the below list to work. Changing the status to merged, but not doing so actually, from the below list would just create the merge request to be added in the merged list by changing the status, but it won't actually work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the late reply, I lost track of this comment.
It is correct for it to just change the status and not actually merge it. Some developers prefer to do the merging themself (not have Allura do the merge) and so then they just update the status. I'm sure the page and form designs could be changed at some point so that is more clear to people, but that's the way it works on "master" now so we shouldn't change that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Few more details to sort out.
self.merge()
will actually do the merge server-side, on behalf of the user. We don't want to do that here, just update the status field.has_access
doesn't ever return "None" but it will act like a boolean, so you can just doand has_access(self.req, 'write')
and that's it. Also no need to use parantheses around individual expressions like that one and(self.req.creator == c.user)
. Save them for keeping "and" and "or" expressions grouped properly.@Dave.
I added that option so as the below list to work. Changing the status to merged, but not doing so actually, from the below list would just create the merge request to be added in the merged list by changing the status, but it won't actually work.
Sorry for the late reply, I lost track of this comment.
It is correct for it to just change the status and not actually merge it. Some developers prefer to do the merging themself (not have Allura do the merge) and so then they just update the status. I'm sure the page and form designs could be changed at some point so that is more clear to people, but that's the way it works on "master" now so we shouldn't change that.
https://forge-allura.apache.org/u/pranav/allura/ci/ac9bee096b8e9bdc0862c41eed7af97f660f2ea2/
Should the creator of merge request be given the permission to change only the status of a merge request to merged?
Last edit: Pranav Sharma 2016-03-06
Creators should only be able to reject it. They shouldn't be able to mark it as merged, because only project developers can actually merge the code.