mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
layerindex: allow empty Actual branch
Exposing the actual_branch field of LayerBranch in the UI was intending to _enable_ setting a non-default value, but the check was accidentally left in a state that _requires_ a value. [YOCTO #15376] Signed-off-by: Tim Orling <tim.orling@konsulko.com>
This commit is contained in:
parent
ac0ef0540a
commit
2825a8b721
|
@ -187,10 +187,11 @@ class EditLayerForm(StyledModelForm):
|
||||||
def clean_actual_branch(self):
|
def clean_actual_branch(self):
|
||||||
import subprocess
|
import subprocess
|
||||||
actual_branch = self.cleaned_data['actual_branch'].strip()
|
actual_branch = self.cleaned_data['actual_branch'].strip()
|
||||||
process = subprocess.Popen(["git", "check-ref-format", "--branch", actual_branch])
|
if len(actual_branch) > 0:
|
||||||
exit_status = process.wait()
|
process = subprocess.Popen(["git", "check-ref-format", "--branch", actual_branch])
|
||||||
if exit_status != 0:
|
exit_status = process.wait()
|
||||||
raise forms.ValidationError("Actual branch should be a valid git branch short name")
|
if exit_status != 0:
|
||||||
|
raise forms.ValidationError("Actual branch should be a valid git branch short name")
|
||||||
return actual_branch
|
return actual_branch
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user