# HG changeset patch # User Marcin Kuzminski # Date 2012-12-13 13:38:45 # Node ID 69b25f1b0b45325864d4b94b40a5d0245539b03f # Parent 53ab820a0b7c206d90a78de32ee5a2033c3aae3e switch to defaultdict for counter implementation diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -545,7 +545,7 @@ class UserModel(BaseModel): .filter(UsersGroupMember.user_id == uid)\ .all() - multiple_counter = collections.Counter() + multiple_counter = collections.defaultdict(int) for perm in user_repo_perms_from_users_groups: r_k = perm.UsersGroupRepoToPerm.repository.repo_name multiple_counter[r_k] += 1 @@ -602,7 +602,7 @@ class UserModel(BaseModel): .filter(UsersGroupMember.user_id == uid)\ .all() - multiple_counter = collections.Counter() + multiple_counter = collections.defaultdict(int) for perm in user_repo_group_perms_from_users_groups: g_k = perm.UsersGroupRepoGroupToPerm.group.group_name multiple_counter[g_k] += 1