Show More
@@ -140,8 +140,9 b' class ReposGroupModel(BaseModel):' | |||
|
140 | 140 | |
|
141 | 141 | def create(self, group_name, group_description, owner, parent=None, just_db=False): |
|
142 | 142 | try: |
|
143 | user = self._get_user(owner) | |
|
143 | 144 | new_repos_group = RepoGroup() |
|
144 |
new_repos_group.user = |
|
|
145 | new_repos_group.user = user | |
|
145 | 146 | new_repos_group.group_description = group_description or group_name |
|
146 | 147 | new_repos_group.parent_group = self._get_repo_group(parent) |
|
147 | 148 | new_repos_group.group_name = new_repos_group.get_new_name(group_name) |
@@ -150,10 +151,11 b' class ReposGroupModel(BaseModel):' | |||
|
150 | 151 | perm_obj = self._create_default_perms(new_repos_group) |
|
151 | 152 | self.sa.add(perm_obj) |
|
152 | 153 | |
|
153 |
#create an ADMIN permission for owner |
|
|
154 | #the owner field of groups | |
|
155 | self.grant_user_permission(repos_group=new_repos_group, | |
|
156 | user=owner, perm='group.admin') | |
|
154 | #create an ADMIN permission for owner except if we're super admin, | |
|
155 | #later owner should go into the owner field of groups | |
|
156 | if not user.is_admin: | |
|
157 | self.grant_user_permission(repos_group=new_repos_group, | |
|
158 | user=owner, perm='group.admin') | |
|
157 | 159 | |
|
158 | 160 | if not just_db: |
|
159 | 161 | # we need to flush here, in order to check if database won't |
General Comments 0
You need to be logged in to leave comments.
Login now