mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 00:47:37 -02:30
Updated migration + serializers as suggested
Signed-off-by: mazhead <mazhead@gmail.com>
This commit is contained in:
@@ -1385,6 +1385,8 @@ class ProjectOptionsSerializer(BaseSerializer):
|
|||||||
errors['scm_branch'] = _('SCM branch cannot be used with archive projects.')
|
errors['scm_branch'] = _('SCM branch cannot be used with archive projects.')
|
||||||
if attrs.get('scm_refspec') and scm_type != 'git':
|
if attrs.get('scm_refspec') and scm_type != 'git':
|
||||||
errors['scm_refspec'] = _('SCM refspec can only be used with git projects.')
|
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:
|
if errors:
|
||||||
raise serializers.ValidationError(errors)
|
raise serializers.ValidationError(errors)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 2.2.16 on 2021-02-02 14:41
|
# Generated by Django 2.2.16 on 2021-04-13 19:21
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
@@ -11,21 +11,11 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='Project',
|
|
||||||
name='scm_track_submodules',
|
|
||||||
field=models.BooleanField(default=False, help_text='Track submodule latest commit on specified branch.'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='ProjectUpdate',
|
|
||||||
name='scm_track_submodules',
|
|
||||||
field=models.BooleanField(default=False, help_text='Track submodule latest commit on specified branch.'),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='project',
|
model_name='project',
|
||||||
name='scm_track_submodules',
|
name='scm_track_submodules',
|
||||||
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
|
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AddField(
|
||||||
model_name='projectupdate',
|
model_name='projectupdate',
|
||||||
name='scm_track_submodules',
|
name='scm_track_submodules',
|
||||||
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
|
field=models.BooleanField(default=False, help_text='Track submodules latest commits on defined branch.'),
|
||||||
|
|||||||
Reference in New Issue
Block a user