Updated migration + serializers as suggested

Signed-off-by: mazhead <mazhead@gmail.com>
This commit is contained in:
mazhead
2021-04-13 21:39:24 +02:00
parent 5f93ba7690
commit 83d340ab1f
2 changed files with 4 additions and 12 deletions

View File

@@ -1385,6 +1385,8 @@ class ProjectOptionsSerializer(BaseSerializer):
errors['scm_branch'] = _('SCM branch cannot be used with archive projects.')
if attrs.get('scm_refspec') and scm_type != 'git':
errors['scm_refspec'] = _('SCM refspec can only be used with git projects.')
if attrs.get('scm_track_submodules') and scm_type != 'git':
errors['scm_track_submodules'] = _('SCM track_submodules can only be used with git projects.')
if errors:
raise serializers.ValidationError(errors)