mirror of
https://github.com/leaders-of-digital-9-task/backend.git
synced 2024-11-22 01:16:33 +03:00
bug fixes
This commit is contained in:
parent
13ab4ea2c2
commit
26b3dc5497
|
@ -165,11 +165,15 @@ class ListProjectSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
fields = ["url", "created"]
|
fields = ["slug", "url", "created"]
|
||||||
extra_kwargs = {
|
extra_kwargs = {
|
||||||
|
"slug": {"read_only": True},
|
||||||
"created": {"read_only": True},
|
"created": {"read_only": True},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def create(self, validated_data):
|
||||||
|
return Project.objects.create(user=self.context["request"].user)
|
||||||
|
|
||||||
|
|
||||||
class ProjectSerializer(serializers.ModelSerializer):
|
class ProjectSerializer(serializers.ModelSerializer):
|
||||||
files = ListDicomSerializer(many=True)
|
files = ListDicomSerializer(many=True)
|
||||||
|
@ -177,3 +181,6 @@ class ProjectSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
fields = ["files", "slug", "created"]
|
fields = ["files", "slug", "created"]
|
||||||
|
|
||||||
|
def create(self, validated_data):
|
||||||
|
return Project.objects.create(user=self.context["request"].user)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user