From 2953f9eb84ce8f6dc54a6f8959f2361bf032fa81 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 20 May 2014 11:22:02 +0200 Subject: [PATCH] Fails on dupplicate email address instead of ignoring the INSERT So you cannot add two times the same address, and you get an error --- public/vroom.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/vroom.pl b/public/vroom.pl index c40324b..8e12911 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -354,7 +354,7 @@ helper add_notification => sub { my ($room,$email) = @_; my $data = $self->get_room($room); return undef unless ($data); - my $sth = eval { $self->db->prepare("INSERT IGNORE INTO notifications (id,email) VALUES (?,?)") } || return undef; + my $sth = eval { $self->db->prepare("INSERT INTO notifications (id,email) VALUES (?,?)") } || return undef; $sth->execute($data->{id},$email) || return undef; return 1; };