Skip to content

Commit 0f51a05

Browse files
committed
only flush DB if there are no errors
1 parent b0f5cd8 commit 0f51a05

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.htaccess

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
RewriteCond %{SERVER_PORT} ^80$
22
RewriteRule ^(.*)$ https://pic1dei.tecnico.ulisboa.pt/$1 [L,R=301]
33

4-
<Files *>
4+
<Files *.*>
55
Order Deny,Allow
66
Deny from all
77
</Files>

index.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ function terminate($error_message = null, $template = 'main.html.twig',
139139
if ($select_form)
140140
$content['select_form'] = $select_form->createView();
141141

142+
if (!$error_message) {
143+
db_flush();
144+
}
142145
echo $twig->render($template, $content + $extra_fields);
143-
db_flush();
144146
exit();
145147
}
146148

0 commit comments

Comments
 (0)