]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Rotate.pm
Try to handle aborted rotation a bit better.
[pr0n] / perl / Sesse / pr0n / Rotate.pm
index eb8d17ebc8c386ea7f1cc746e9d410a0355dc4e6..71102eb1336e5c8960e3492d248065f6b4557b41 100644 (file)
@@ -23,12 +23,13 @@ sub handler {
 
        {
                # Enable transactions and error raising temporarily
-               local $dbh->{AutoCommit} = 0;
                local $dbh->{RaiseError} = 1;
 
                my @params = $apr->param();
                my $key;
                for $key (@params) {
+                       local $dbh->{AutoCommit} = 0;
+
                        # Rotation
                        if ($key =~ /^rot-(\d+)-(90|180|270)$/ && $apr->param($key) eq 'on') {
                                my ($id, $rotval) = ($1,$2);