Hide Forgot
Description of problem: Currently, the Beaker WebUI allows us to either assign a new loan, or to return an existing loan. If a system is loaned already, and we wish to loan it to a new user, we need to first remove the existing loan and then apply a new loan. To prevent the scheduler from grabbing the system in between these two actions, we temporarily set the system's status to 'Broken', so the final workflow for changing a loan looks like: 1) Set system to 'Broken' 2) Remove existing loan 3) Apply new loan to second user 4) Set system to 'Automated' It'd be convenient if there were a way to directly transfer or move an existing loan without having to do the shuffle described above.
I've introduced a regression with this. Owner's of systems may have trouble loaning a machine to themselves. Here are two workarounds 1) If the system has a group (of which you are a part) set the group to have admin rights. 2) Get an Admin to loan it to you. Because we have these workarounds, I don't think this warrants a hotfix. Here is the suggested patch though. diff --git a/Server/bkr/server/model.py b/Server/bkr/server/model.py index 38cae77..f5f0117 100644 --- a/Server/bkr/server/model.py +++ b/Server/bkr/server/model.py @@ -1911,6 +1911,12 @@ def is_admin(self,group_id=None,user_id=None,groups=None,*args,**kw): return True except AttributeError,e: pass #We may not be logged in... + if not user_id: + try: + user_id = identity.current.user.user_id + except AttributeError: + pass + #If we are the owner.... if self.owner == User.by_id(user_id): return True
This bug is marked as closed, but the regression described in comment #2 has not (as far as I can see) been resolved. Am I missing something here?
No, that's correct.
This is covered by 730321