🐜 Prevent to store a invitation file twice in DB / have it twice in mail
This commit is contained in:
parent
a36ad49133
commit
2f8758c865
|
@ -228,8 +228,12 @@ sub send_mail_to_ldap_user {
|
|||
my @files = ();
|
||||
if ($c->config('invitations')->{'save_files_url_in_db'} && $urls->size) {
|
||||
my $guest_files = $invitation->files;
|
||||
my %list_token;
|
||||
if ($guest_files) {
|
||||
$guest_files = decode_json($guest_files);
|
||||
for my $file (@{$guest_files}) {
|
||||
$list_token{$file->{token}} = 1;
|
||||
}
|
||||
} else {
|
||||
$guest_files = [];
|
||||
}
|
||||
|
@ -237,8 +241,10 @@ sub send_mail_to_ldap_user {
|
|||
$urls->each(sub {
|
||||
my ($e, $num) = @_;
|
||||
$e = decode_json($e);
|
||||
push @{$guest_files}, $e;
|
||||
push @files, $e;
|
||||
if (!defined($list_token{$e->{token}})) {
|
||||
push @{$guest_files}, $e;
|
||||
push @files, $e;
|
||||
}
|
||||
});
|
||||
$invitation->files(encode_json($guest_files));
|
||||
$invitation->write;
|
||||
|
|
|
@ -512,7 +512,7 @@ msgstr ""
|
|||
msgid "Signin"
|
||||
msgstr ""
|
||||
|
||||
#: lib/Lufi/Controller/Invitation.pm:277 themes/default/templates/invitations/exception.html.ep:16
|
||||
#: lib/Lufi/Controller/Invitation.pm:283 themes/default/templates/invitations/exception.html.ep:16
|
||||
msgid "Sorry, the invitation doesn’t exist. Are you sure you are on the right URL?"
|
||||
msgstr ""
|
||||
|
||||
|
@ -534,7 +534,7 @@ msgid "Sorry, your invitation has expired or has been deleted. Please contact %1
|
|||
msgstr ""
|
||||
|
||||
#. ($invitation->ldap_user_mail)
|
||||
#: lib/Lufi/Controller/Invitation.pm:270
|
||||
#: lib/Lufi/Controller/Invitation.pm:276
|
||||
msgid "The URLs of your files have been sent by email to %1."
|
||||
msgstr ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue