Skip to content

Commit dd70efa

Browse files
authored
Merge pull request #1045 from proditis/master
dont notify owner and redir to index
2 parents 38ce17c + cc2a0a3 commit dd70efa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

frontend/modules/team/controllers/DefaultController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function actionReject($id)
357357
if($tp->player_id!==Yii::$app->user->id && $tp->team_id!==Yii::$app->user->identity->teamLeader->id)
358358
{
359359
Yii::$app->session->setFlash('error', \Yii::t('app','You have no permission to cancel this membership.'));
360-
return $this->redirect(['view','token'=>$token]);
360+
return $this->redirect(['index']);
361361
}
362362

363363
if($tp->delete()===false)
@@ -371,8 +371,8 @@ public function actionReject($id)
371371
if(Yii::$app->user->identity->teamLeader)
372372
{
373373
$this->delete_with_extras();
374-
$redir=['index'];
375374
}
375+
$redir=['index'];
376376
Yii::$app->db->createCommand("CALL repopulate_team_stream(:tid)")->bindValue(':tid',$tp->team_id)->execute();
377377
Yii::$app->session->setFlash('success', \Yii::t('app','Your membership has been withdrawn.'));
378378
}

frontend/modules/team/models/TeamPlayer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public function notifyPartOwner()
107107

108108
public function notifyRejectPlayer()
109109
{
110+
// Don't notify the players for deleting their own team
111+
if($this->player_id===$this->team->owner_id) return;
110112
$msg=\Yii::t('app','Hi there, your team membership got rejected. Find another team to join.');
111113
return $this->sendNotification($this->player_id,$msg);
112114
}

0 commit comments

Comments
 (0)