Checks for users with that email address
This commit is contained in:
@@ -254,7 +254,7 @@ def handle_sendemail_invite(email,name,code,teamname,manager):
|
|||||||
message += 'https://rowsandall.com/rowers/me/invitation/'+code+' \n\n'
|
message += 'https://rowsandall.com/rowers/me/invitation/'+code+' \n\n'
|
||||||
|
|
||||||
message += 'You can also manually accept your team membership with the code.\n'
|
message += 'You can also manually accept your team membership with the code.\n'
|
||||||
message += 'You will need to do this if you registered under a differnt email address than this one.\n'
|
message += 'You will need to do this if you registered under a different email address than this one.\n'
|
||||||
message += 'Code: '+code+'\n'
|
message += 'Code: '+code+'\n'
|
||||||
message += 'Link to manually accept your team membership: '
|
message += 'Link to manually accept your team membership: '
|
||||||
message += 'https://rowsandall.com/rowers/me/invitation\n\n'
|
message += 'https://rowsandall.com/rowers/me/invitation\n\n'
|
||||||
|
|||||||
@@ -169,6 +169,12 @@ def create_invite(team,manager,user=None,email=''):
|
|||||||
return (0,'Already member of that team')
|
return (0,'Already member of that team')
|
||||||
elif email==None or email=='':
|
elif email==None or email=='':
|
||||||
return (0,'Invalid request - missing email or user')
|
return (0,'Invalid request - missing email or user')
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
r2 = Rower.objects.get(user__email=email)
|
||||||
|
user = User.objects.get(rower=r2)
|
||||||
|
except Rower.DoesNotExist:
|
||||||
|
user=None
|
||||||
|
|
||||||
if count_club_members(team.manager)+count_invites(team.manager) < r.clubsize:
|
if count_club_members(team.manager)+count_invites(team.manager) < r.clubsize:
|
||||||
codes = [i.code for i in TeamInvite.objects.all()]
|
codes = [i.code for i in TeamInvite.objects.all()]
|
||||||
@@ -242,7 +248,11 @@ def reject_invitation(user,id):
|
|||||||
|
|
||||||
|
|
||||||
def send_invite_email(id):
|
def send_invite_email(id):
|
||||||
invitation = TeamInvite.objects.get(id=id)
|
try:
|
||||||
|
invitation = TeamInvite.objects.get(id=id)
|
||||||
|
except TeamInvite.DoesNotExist:
|
||||||
|
return (0,'Invitation doesn not exist')
|
||||||
|
|
||||||
if invitation.user:
|
if invitation.user:
|
||||||
email = invitation.user.email
|
email = invitation.user.email
|
||||||
name = invitation.user.first_name + " " + invitation.user.last_name
|
name = invitation.user.first_name + " " + invitation.user.last_name
|
||||||
|
|||||||
Reference in New Issue
Block a user