Skip to content
Snippets Groups Projects
Commit 0d20058a authored by ml bonhomme's avatar ml bonhomme :bee:
Browse files

apply review

parent 5d7df8b6
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !2299. Comments created here will be created in the context of that merge request.
......@@ -603,7 +603,12 @@ class DockerWorkerVersionSerializer(serializers.ModelSerializer):
max_length=100,
help_text="The slug of the worker type of the worker to which a new version will be published.",
)
worker_description = serializers.CharField(required=False, style={"base_template": "textarea.html"})
worker_description = serializers.CharField(
required=False,
allow_null=True,
allow_blank=True,
style={"base_template": "textarea.html"},
)
revision_hash = serializers.CharField(max_length=50)
revision_message = serializers.CharField(required=False, default="created from docker image")
revision_author = serializers.CharField(max_length=50, required=False, default="default")
......@@ -738,7 +743,8 @@ class DockerWorkerVersionSerializer(serializers.ModelSerializer):
if worker.name != validated_data["worker_name"] or worker.type_id != worker_type.id or (description is not None and worker.description != description):
worker.name = validated_data["worker_name"]
worker.type_id = worker_type.id
worker.description = description if description else worker.description
if description is not None:
worker.description = description
worker.save()
# Finally, create the worker version and mark it as available
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment