fix tests

This commit is contained in:
Jake Jackson 2020-10-27 00:39:51 -04:00
parent dbc4b677f6
commit abd0eb53bf

View File

@ -1333,7 +1333,7 @@ class ProjectOptionsSerializer(BaseSerializer):
scm_type = attrs.get('scm_type', u'') or u''
if self.instance and not scm_type:
valid_local_paths.append(self.instance.local_path)
if scm_type and self.instance.local_path != attrs.get('local_path'):
if scm_type and "local_path" in attrs and self.instance.local_path != attrs['local_path']:
errors['local_path'] = _(f'Cannot change local_path for {scm_type}-based projects')
if scm_type:
attrs.pop('local_path', None)