Fix some problems with the permission prototype application on repository create.
This commit is contained in:
parent
922dbc502e
commit
58412ff6b3
1 changed files with 2 additions and 2 deletions
|
@ -788,7 +788,7 @@ def __apply_default_permissions(repo, proto_query, name_property,
|
||||||
create_permission_func):
|
create_permission_func):
|
||||||
final_protos = {}
|
final_protos = {}
|
||||||
for proto in proto_query:
|
for proto in proto_query:
|
||||||
applies_to = proto_query.delegate_team or proto_query.delegate_user
|
applies_to = proto.delegate_team or proto.delegate_user
|
||||||
name = getattr(applies_to, name_property)
|
name = getattr(applies_to, name_property)
|
||||||
# We will skip the proto if it is pre-empted by a more important proto
|
# We will skip the proto if it is pre-empted by a more important proto
|
||||||
if name in final_protos and proto.activating_user is None:
|
if name in final_protos and proto.activating_user is None:
|
||||||
|
@ -816,7 +816,7 @@ def create_repository(namespace, name, creating_user, visibility='private'):
|
||||||
# Permission prototypes only work for orgs
|
# Permission prototypes only work for orgs
|
||||||
org = get_organization(namespace)
|
org = get_organization(namespace)
|
||||||
user_clause = (PermissionPrototype.activating_user == creating_user |
|
user_clause = (PermissionPrototype.activating_user == creating_user |
|
||||||
PermissionPrototype >> None)
|
PermissionPrototype.activating_user >> None)
|
||||||
|
|
||||||
team_protos = (PermissionPrototype
|
team_protos = (PermissionPrototype
|
||||||
.select()
|
.select()
|
||||||
|
|
Reference in a new issue