Skip to content

Commit

Permalink
Merge pull request #1731 from doccano/fix/projectEdit
Browse files Browse the repository at this point in the history
Fix project update
  • Loading branch information
Hironsan committed Mar 14, 2022
2 parents cb1e39a + 2fdfb8f commit 5a56705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ def create(self, validated_data):
tags.save(project=project)
return project

def update(self, instance, validated_data):
# Don't update tags. Please use TagAPI.
validated_data.pop("tags", None)
return super().update(instance, validated_data)


class TextClassificationProjectSerializer(ProjectSerializer):
class Meta(ProjectSerializer.Meta):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class ProjectApplicationService {
public async update(item: ProjectWriteDTO): Promise<void> {
try {
const project = this.toWriteModel(item)
project.tags = []
await this.repository.update(project)
} catch(e: any) {
throw new Error(e.response.data.detail)
Expand Down

0 comments on commit 5a56705

Please sign in to comment.