Hi,
sorry, no I didn't test this. It was just a shorthand of a longtime c+
+ user
to sort the list without another temporary. Now after testing, I see
you are
correct, this code does indeed return 'None'. So this does mean two
things:
1) I should have read the documentation better 'act in place' means
it returns
'None'
2) To sort the list one needs a temporary like in the following
patch:
Index: perm.py
===================================================================
--- perm.py (Revision 4635)
+++ perm.py (Arbeitskopie)
@@ -160,7 +160,9 @@
elif nummembers:
groups.append(username)
- return list(result)
+ sorted_result = list(result)
+ sorted_result.sort()
+ return sorted_result
def get_all_permissions(self):
"""Return all permissions for all users.
Would this be interesting enough to be put into trac or do I just keep
it in our cache of
customisations.
-- Max
On 3 Feb., 00:34, "Matt Good" <[EMAIL PROTECTED]> wrote:
> On Feb 2, 5:44 am, "mb" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi,
>
> > as I already posted, the upgrade worked fine, but now we have
> > different problem.
> > We use the 'restrict_owner = true' option for tickets, so we always
> > get a drop down
> > box with all possible owners. This box was sorted, but since the
> > upgrade it is not
> > anymore. Could this be because of the changes in r4625?
>
> > Anyway would the following patch solve this problem:
>
> > Index: perm.py
> > ===================================================================
> > --- perm.py (Revision 4635)
> > +++ perm.py (Arbeitskopie)
> > @@ -160,7 +160,7 @@
> > elif nummembers:
> > groups.append(username)
>
> > - return list(result)
> > + return list(result).sort()
>
> > def get_all_permissions(self):
> > """Return all permissions for all users.
>
> Have you tested this? The sort() method acts in-place, so it does not
> return a sorted version of the list, so that would always return
> `None`.
>
> -- Matt Good
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---