File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1014,6 +1014,7 @@ settings.transfer_succeed = The repository has been transferred.
10141014settings.confirm_delete = Delete Repository
10151015settings.add_collaborator = Add Collaborator
10161016settings.add_collaborator_success = The collaborator has been added.
1017+ settings.add_collaborator_inactive_user = Cannot add an inactive user as a collaborator.
10171018settings.delete_collaborator = Remove
10181019settings.collaborator_deletion = Remove Collaborator
10191020settings.collaborator_deletion_desc = Removing a collaborator will revoke their access to this repository. Continue?
Original file line number Diff line number Diff line change @@ -381,6 +381,12 @@ func CollaborationPost(ctx *context.Context) {
381381 return
382382 }
383383
384+ if ! u .IsActive {
385+ ctx .Flash .Error ("cannot add an inactive user as a collaborator" )
386+ ctx .Redirect (setting .AppSubURL + ctx .Req .URL .Path )
387+ return
388+ }
389+
384390 // Organization is not allowed to be added as a collaborator.
385391 if u .IsOrganization () {
386392 ctx .Flash .Error (ctx .Tr ("repo.settings.org_not_allowed_to_be_collaborator" ))
You can’t perform that action at this time.
0 commit comments