We can't mix GET and POST (in the comment form)

in_response_to was always null
This commit is contained in:
Bat
2018-06-27 00:19:18 +02:00
parent b26649e8c0
commit 68a041711c
8 changed files with 36 additions and 27 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ sql_function!(setval, setval_t, (seq: ::diesel::sql_types::Text, val: ::diesel::
fn get_next_id(conn: &PgConnection, seq: &str) -> i32 {
// We cant' use currval because it may fail if nextval have never been called before
let next = select(nextval(seq)).get_result::<i64>(conn).expect("Next ID fail");
select(setval(seq, next - 1)).get_result::<i64>(conn).expect("Reset ID fail");
if next > 1 {
select(setval(seq, next - 1)).get_result::<i64>(conn).expect("Reset ID fail");
}
next as i32
}