##// END OF EJS Templates
switch to defaultdict for counter implementation
marcink -
r3096:69b25f1b beta
parent child Browse files
Show More
@@ -545,7 +545,7 b' class UserModel(BaseModel):'
545 545 .filter(UsersGroupMember.user_id == uid)\
546 546 .all()
547 547
548 multiple_counter = collections.Counter()
548 multiple_counter = collections.defaultdict(int)
549 549 for perm in user_repo_perms_from_users_groups:
550 550 r_k = perm.UsersGroupRepoToPerm.repository.repo_name
551 551 multiple_counter[r_k] += 1
@@ -602,7 +602,7 b' class UserModel(BaseModel):'
602 602 .filter(UsersGroupMember.user_id == uid)\
603 603 .all()
604 604
605 multiple_counter = collections.Counter()
605 multiple_counter = collections.defaultdict(int)
606 606 for perm in user_repo_group_perms_from_users_groups:
607 607 g_k = perm.UsersGroupRepoGroupToPerm.group.group_name
608 608 multiple_counter[g_k] += 1
General Comments 0
You need to be logged in to leave comments. Login now