Skip to content

Commit

Permalink
fix: datasets permission is missing (#7751)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywoola authored Aug 28, 2024
1 parent 9342b4b commit 3a071b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def get_datasets_by_ids(ids, tenant_id):
return datasets.items, datasets.total

@staticmethod
def create_empty_dataset(tenant_id: str, name: str, indexing_technique: Optional[str], account: Account):
def create_empty_dataset(
tenant_id: str, name: str, indexing_technique: Optional[str], account: Account, permission: Optional[str]
):
# check if dataset name already exists
if Dataset.query.filter_by(name=name, tenant_id=tenant_id).first():
raise DatasetNameDuplicateError(f"Dataset with name {name} already exists.")
Expand All @@ -153,6 +155,7 @@ def create_empty_dataset(tenant_id: str, name: str, indexing_technique: Optional
dataset.tenant_id = tenant_id
dataset.embedding_model_provider = embedding_model.provider if embedding_model else None
dataset.embedding_model = embedding_model.model if embedding_model else None
dataset.permission = permission if permission else DatasetPermissionEnum.ONLY_ME
db.session.add(dataset)
db.session.commit()
return dataset
Expand Down

0 comments on commit 3a071b8

Please sign in to comment.