diff --git a/data/database.py b/data/database.py index ab30d2d22..6e1784db7 100644 --- a/data/database.py +++ b/data/database.py @@ -217,8 +217,9 @@ class LogEntryKind(BaseModel): class LogEntry(BaseModel): kind = ForeignKeyField(LogEntryKind, index=True) - account = ForeignKeyField(User, index=True, related_name = 'account') - performer = ForeignKeyField(User, index=True, null=True, related_name = 'performer') + account = ForeignKeyField(User, index=True, related_name='account') + performer = ForeignKeyField(User, index=True, null=True, + related_name='performer') repository = ForeignKeyField(Repository, index=True, null=True) access_token = ForeignKeyField(AccessToken, null=True) datetime = DateTimeField(default=datetime.now, index=True) @@ -229,4 +230,5 @@ class LogEntry(BaseModel): all_models = [User, Repository, Image, AccessToken, Role, RepositoryPermission, Visibility, RepositoryTag, EmailConfirmation, FederatedLogin, LoginService, QueueItem, - RepositoryBuild, Team, TeamMember, TeamRole, Webhook, LogEntryKind, LogEntry] + RepositoryBuild, Team, TeamMember, TeamRole, Webhook, + LogEntryKind, LogEntry] diff --git a/data/model.py b/data/model.py index 0ebc95125..ccb4b8d21 100644 --- a/data/model.py +++ b/data/model.py @@ -930,7 +930,7 @@ def set_team_repo_permission(team_name, namespace_name, repository_name, def purge_repository(namespace_name, repository_name): fetched = Repository.get(Repository.name == repository_name, Repository.namespace == namespace_name) - fetched.delete_instance(recursive=True, delete_nullable=True) + fetched.delete_instance(recursive=True) def get_private_repo_count(username):