This commit is contained in:
Joseph Schorr 2014-09-29 17:01:07 -04:00
commit 5f776771d1
2 changed files with 1 additions and 4 deletions

View file

@ -168,7 +168,6 @@ class Visibility(BaseModel):
class Repository(BaseModel): class Repository(BaseModel):
namespace = CharField()
namespace_user = ForeignKeyField(User) namespace_user = ForeignKeyField(User)
name = CharField() name = CharField()
visibility = ForeignKeyField(Visibility) visibility = ForeignKeyField(Visibility)
@ -180,7 +179,6 @@ class Repository(BaseModel):
read_slaves = (read_slave,) read_slaves = (read_slave,)
indexes = ( indexes = (
# create a unique index on namespace and name # create a unique index on namespace and name
(('namespace', 'name'), True),
(('namespace_user', 'name'), True), (('namespace_user', 'name'), True),
) )

View file

@ -1082,8 +1082,7 @@ def __apply_default_permissions(repo, proto_query, name_property,
def create_repository(namespace, name, creating_user, visibility='private'): def create_repository(namespace, name, creating_user, visibility='private'):
private = Visibility.get(name=visibility) private = Visibility.get(name=visibility)
namespace_user = User.get(username=namespace) namespace_user = User.get(username=namespace)
repo = Repository.create(namespace=namespace, name=name, visibility=private, repo = Repository.create(name=name, visibility=private, namespace_user=namespace_user)
namespace_user=namespace_user)
admin = Role.get(name='admin') admin = Role.get(name='admin')
if creating_user and not creating_user.organization: if creating_user and not creating_user.organization: