fixed invite link system
This commit is contained in:
@ -143,9 +143,9 @@ class InviteLinkTable(tables.Table):
|
|||||||
link = tables.TemplateColumn(
|
link = tables.TemplateColumn(
|
||||||
"<a href='{% url 'view_signup' record.uuid %}' >" + _('Link') + "</a>"
|
"<a href='{% url 'view_signup' record.uuid %}' >" + _('Link') + "</a>"
|
||||||
)
|
)
|
||||||
delete = tables.TemplateColumn(
|
# delete = tables.TemplateColumn(
|
||||||
"<a href='{% url 'delete_invite_link' record.id %}' >" + _('Delete') + "</a>" # noqa: E501
|
# "<a href='{% url 'delete_invite_link' record.pk %}' >" + _('Delete') + "</a>"
|
||||||
)
|
# )
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = InviteLink
|
model = InviteLink
|
||||||
|
@ -227,7 +227,7 @@ class InviteLinkCreate(GroupRequiredMixin, CreateView):
|
|||||||
message += _(' to join their Tandoor Recipes space ') + escape(self.request.space.name) + '.\n\n'
|
message += _(' to join their Tandoor Recipes space ') + escape(self.request.space.name) + '.\n\n'
|
||||||
message += _('Click the following link to activate your account: ') + self.request.build_absolute_uri(reverse('view_signup', args=[str(obj.uuid)])) + '\n\n'
|
message += _('Click the following link to activate your account: ') + self.request.build_absolute_uri(reverse('view_signup', args=[str(obj.uuid)])) + '\n\n'
|
||||||
message += _('If the link does not work use the following code to manually join the space: ') + str(obj.uuid) + '\n\n'
|
message += _('If the link does not work use the following code to manually join the space: ') + str(obj.uuid) + '\n\n'
|
||||||
message += _('The invitation is valid until ') + obj.valid_until + '\n\n'
|
message += _('The invitation is valid until ') + str(obj.valid_until) + '\n\n'
|
||||||
message += _('Tandoor Recipes is an Open Source recipe manager. Check it out on GitHub ') + 'https://github.com/vabene1111/recipes/'
|
message += _('Tandoor Recipes is an Open Source recipe manager. Check it out on GitHub ') + 'https://github.com/vabene1111/recipes/'
|
||||||
|
|
||||||
send_mail(
|
send_mail(
|
||||||
@ -236,7 +236,6 @@ class InviteLinkCreate(GroupRequiredMixin, CreateView):
|
|||||||
None,
|
None,
|
||||||
[obj.email],
|
[obj.email],
|
||||||
fail_silently=False,
|
fail_silently=False,
|
||||||
|
|
||||||
)
|
)
|
||||||
messages.add_message(self.request, messages.SUCCESS,
|
messages.add_message(self.request, messages.SUCCESS,
|
||||||
_('Invite link successfully send to user.'))
|
_('Invite link successfully send to user.'))
|
||||||
@ -246,7 +245,7 @@ class InviteLinkCreate(GroupRequiredMixin, CreateView):
|
|||||||
except (SMTPException, BadHeaderError, TimeoutError):
|
except (SMTPException, BadHeaderError, TimeoutError):
|
||||||
messages.add_message(self.request, messages.ERROR, _('Email to user could not be send, please share link manually.'))
|
messages.add_message(self.request, messages.ERROR, _('Email to user could not be send, please share link manually.'))
|
||||||
|
|
||||||
return HttpResponseRedirect(reverse('list_invite_link'))
|
return HttpResponseRedirect(reverse('index'))
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(InviteLinkCreate, self).get_context_data(**kwargs)
|
context = super(InviteLinkCreate, self).get_context_data(**kwargs)
|
||||||
|
Reference in New Issue
Block a user