Commit d153c56e authored by Robert Czechowski's avatar Robert Czechowski

Fix contest export failing with postgres due to incorrect type expected from start_date field

parent ed3c61df
Pipeline #836 passed with stages
in 18 minutes and 41 seconds
......@@ -1391,8 +1391,7 @@ pub fn admin_show_participation<T: MedalConnection>(conn: &T, user_id: i32, cont
fill_user_data(&user, &mut data);
data.insert("userid".to_string(), to_json(&user.id));
let participation =
conn.get_participation(user.id, contest_id).ok_or(MedalError::AccessDenied)?;
let participation = conn.get_participation(user.id, contest_id).ok_or(MedalError::AccessDenied)?;
data.insert("start_date".to_string(),
to_json(&self::time::strftime("%FT%T%z", &self::time::at(participation.start)).unwrap()));
......
......@@ -947,7 +947,8 @@ impl MedalConnection for Connection {
row.get::<_, Option<String>>(16),
row.get::<_, Option<String>>(17)),
row.get::<_, Option<i32>>(18),
row.get::<_, Option<String>>(19),
row.get::<_, Option<self::time::Timespec>>(19)
.map(|ts| self::time::strftime("%FT%T%z", &self::time::at(ts)).unwrap()),
points))
.unwrap();
})
......@@ -1111,8 +1112,8 @@ impl MedalConnection for Connection {
WHERE session = $1
AND contest = $2";
self.query_map_one(query, &[&session_id, &contest_id], |row| Participation { contest: contest_id,
user: session_id,
start: row.get(0) })
user: session_id,
start: row.get(0) })
.ok()?
}
......
......@@ -1059,7 +1059,8 @@ impl MedalConnection for Connection {
row.get::<_, Option<String>>(16),
row.get::<_, Option<String>>(17)),
row.get::<_, Option<i32>>(18),
row.get::<_, Option<String>>(19),
row.get::<_, Option<self::time::Timespec>>(19)
.map(|ts| self::time::strftime("%FT%T%z", &self::time::at(ts)).unwrap()),
points))
.unwrap();
})
......@@ -1223,8 +1224,8 @@ impl MedalConnection for Connection {
WHERE session = $1
AND contest = $2";
self.query_map_one(query, &[&session_id, &contest_id], |row| Participation { contest: contest_id,
user: session_id,
start: row.get(0) })
user: session_id,
start: row.get(0) })
.ok()?
}
......
......@@ -1059,7 +1059,8 @@ impl MedalConnection for Connection {
row.get::<_, Option<String>>(16),
row.get::<_, Option<String>>(17)),
row.get::<_, Option<i32>>(18),
row.get::<_, Option<String>>(19),
row.get::<_, Option<self::time::Timespec>>(19)
.map(|ts| self::time::strftime("%FT%T%z", &self::time::at(ts)).unwrap()),
points))
.unwrap();
})
......@@ -1223,8 +1224,8 @@ impl MedalConnection for Connection {
WHERE session = ?1
AND contest = ?2";
self.query_map_one(query, &[&session_id, &contest_id], |row| Participation { contest: contest_id,
user: session_id,
start: row.get(0) })
user: session_id,
start: row.get(0) })
.ok()?
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment