From 50a90685d2aaaa4ea9b3752fe6d5505c9f954239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= <37972689+YangGuoXuan-0503@users.noreply.github.com> Date: Wed, 21 Aug 2024 22:14:19 +0800 Subject: [PATCH] fix: init metadata view (#6609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: init metadata view * feat: optimize code --------- Co-authored-by: 杨国璇 --- seahub/repo_metadata/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/repo_metadata/models.py b/seahub/repo_metadata/models.py index 516dee046c7..d65affe0f0f 100644 --- a/seahub/repo_metadata/models.py +++ b/seahub/repo_metadata/models.py @@ -61,7 +61,7 @@ class Meta: class RepoView(object): - def __init__(self, name, type= 'table', view_ids=None): + def __init__(self, name, type='table', view_ids=None): self.name = name self.type = type self.view_json = {} @@ -84,7 +84,7 @@ def init_view(self, view_ids=None): class RepoMetadataViewsManager(models.Manager): - def add_view(self, repo_id, view_name, view_type): + def add_view(self, repo_id, view_name, view_type='table'): metadata_views = self.filter(repo_id=repo_id).first() if not metadata_views: new_view = RepoView(view_name)