Issues

Issue #217 resolved

Sort repositories dropdown

Thomas Johansson
created an issue

Currently it doesn't appear like the user dropdown for repositories is sorted in any particular order.

Sorting it alphabetically would be nice.

Comments (16)

  1. Mads Sülau Valstorp Jørgensen

    Works great here. Just looked at the __cmp__ method and the call to sorted() and both are intact in tip.

    How does it look at your end? Are you running python 2.5 or 2.4? (not that it should matter) Are the two calls I've mentioned intact in your copy? Template changes? Dirty cache?

  2. Eirik Stavem

    Ah, I see, the problem is probably the repositories where I'm owner. All my repos are sorted correctly, except that the first repo in the dropdown is my "Testing" repo, which I added recently.

  3. Mads Sülau Valstorp Jørgensen

    On second hand, I will not fix this in the sorting, but leave the fix for the other ticket. Otherwise the sorting will just be forgotten, and will yield an unexpected result.

    The code needed to fix it would have been:

        def __cmp__(self, other):
            if isinstance(other, self.__class__):
                return cmp(self.name.lower(), other.name.lower())
            return cmp(self.name.lower(), other.lower())
    
  4. Log in to comment