chg: [galaxyCluster:publish] Slightly simplified save process

pull/6120/head
mokaddem 2020-07-14 14:30:20 +02:00
parent 45d1b3c109
commit 70f1ccf231
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 8 deletions

View File

@ -470,13 +470,11 @@ class GalaxyCluster extends AppModel
{
if (is_numeric($cluster)) {
$clusterId = $cluster;
$this->id = $cluster;
$saved = $this->saveField('published', 1);
} elseif (isset($cluster['GalaxyCluster'])) {
$clusterId = $cluster['GalaxyCluster']['id'];
$cluster['GalaxyCluster']['published'] = true;
$saved = $this->save($cluster, array('fieldList' => array('published')));
}
$this->id = $clusterId;
$saved = $this->saveField('published', True);
if ($saved) {
$uploaded = $this->uploadClusterToServersRouter($clusterId);
return $uploaded;
@ -488,12 +486,10 @@ class GalaxyCluster extends AppModel
{
if (is_numeric($cluster)) {
$this->id = $cluster;
return $this->saveField('published', 0);
} elseif (isset($cluster['GalaxyCluster'])) {
$cluster['GalaxyCluster']['published'] = false;
return $this->save($cluster, array('fieldList' => array('published')));
$this->id = $cluster['GalaxyCluster']['id'];
}
return false;
return $this->saveField('published', False);
}
/**