* Fix bug when creating a repo without gitlabProject.

This commit is contained in:
dingguodong
2021-08-27 17:37:28 +08:00
parent 0a56e0100e
commit 033ffbb3ed
+2 -2
View File
@@ -224,7 +224,7 @@ class repoModel extends model
if($data->encrypt == 'base64') $data->password = base64_encode($data->password);
$this->dao->insert(TABLE_REPO)->data($data, $skip = 'gitlabHost,gitlabToken,gitlabProject')
->batchCheck($this->config->repo->create->requiredFields, 'notempty')
->checkIF($data->SCM == 'GitLab', 'gitlabProject', 'notempty')
->checkIF($data->SCM == 'Gitlab', 'gitlabProject', 'notempty')
->checkIF($data->SCM == 'Subversion', $this->config->repo->svn->requiredFields, 'notempty')
->autoCheck()
->exec();
@@ -282,7 +282,7 @@ class repoModel extends model
$this->dao->update(TABLE_REPO)->data($data, $skip = 'gitlabHost,gitlabToken,gitlabProject')
->batchCheck($this->config->repo->edit->requiredFields, 'notempty')
->checkIF($data->SCM == 'Subversion', $this->config->repo->svn->requiredFields, 'notempty')
->checkIF($data->SCM == 'GitLab', 'extra', 'notempty')
->checkIF($data->SCM == 'Gitlab', 'extra', 'notempty')
->autoCheck()
->where('id')->eq($id)->exec();