@@ -527,6 +527,7 @@ public static NotificationEvent afterNewPullRequest(User sender, PullRequest pul
527527 }
528528
529529 public String getUrlToView () {
530+ Organization organization ;
530531 switch (eventType ) {
531532 case MEMBER_ENROLL_REQUEST :
532533 if (getProject () == null ) {
@@ -535,13 +536,25 @@ public String getUrlToView() {
535536 return routes .ProjectApp .members (
536537 getProject ().owner , getProject ().name ).url ();
537538 }
539+ case MEMBER_ENROLL_ACCEPT :
540+ if (getProject () == null ) {
541+ return null ;
542+ } else {
543+ return routes .ProjectApp .project (
544+ getProject ().owner , getProject ().name ).url ();
545+ }
538546 case ORGANIZATION_MEMBER_ENROLL_REQUEST :
539- Organization organization = getOrganization ();
547+ organization = getOrganization ();
540548 if (organization == null ) {
541549 return null ;
542550 }
543551 return routes .OrganizationApp .members (organization .name ).url ();
544-
552+ case ORGANIZATION_MEMBER_ENROLL_ACCEPT :
553+ organization = getOrganization ();
554+ if (organization == null ) {
555+ return null ;
556+ }
557+ return routes .OrganizationApp .organization (organization .name ).url ();
545558 case NEW_COMMIT :
546559 if (getProject () == null ) {
547560 return null ;
@@ -1162,6 +1175,7 @@ public static void afterMemberRequest(Project project, User user, RequestState s
11621175 break ;
11631176 case ACCEPT :
11641177 notiEvent .title = formatMemberAcceptTitle (project , user );
1178+ notiEvent .eventType = MEMBER_ENROLL_ACCEPT ;
11651179 notiEvent .oldValue = RequestState .REQUEST .name ();
11661180 break ;
11671181 }
@@ -1192,6 +1206,7 @@ public static void afterOrganizationMemberRequest(Organization organization, Use
11921206 break ;
11931207 case ACCEPT :
11941208 notiEvent .title = formatMemberAcceptTitle (organization , user );
1209+ notiEvent .eventType = ORGANIZATION_MEMBER_ENROLL_ACCEPT ;
11951210 notiEvent .oldValue = RequestState .REQUEST .name ();
11961211 break ;
11971212 }
0 commit comments