Skip to content

Commit

Permalink
fix min length for circle name
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Oct 22, 2024
1 parent f3ad9aa commit 583c6bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Command/MigrateCustomGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ public function migrateTeams(): void {
continue; // if group or owner is not know, we ignore the entry.
}

$name = $rowCG['display_name'];
while(strlen($name) < 3) {
$name = '_' . $name;
}

// based on owner's userid, we create federateduser and a new circle
$this->output->writeln('+ New Team <info>' . $rowCG['display_name'] . '</info>, owner by <info>' . $ownerId . '</info>');
$this->output->writeln('+ New Team <info>' . $name . '</info>, owner by <info>' . $ownerId . '</info>');
$owner = $this->cachedFed($ownerId);

$this->circlesManager->startSession($owner);
try {
$circle = $this->circlesManager->createCircle($rowCG['display_name']);
$circle = $this->circlesManager->createCircle($name);
} catch (\Exception $e) {
$this->output->writeln('<error>' . get_class($e) . ' ' . $e->getMessage() . '</error> with data ' . json_encode($rowCG));
$this->logger->log(2, 'error while creating circle', ['exception' => $e]);
Expand Down

0 comments on commit 583c6bf

Please sign in to comment.