Commit 2b1755a8 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Show even hidden contests in overview of all contests

parent 1afc0a9e
Pipeline #554 passed with stages
in 20 minutes and 42 seconds
...@@ -185,7 +185,7 @@ pub fn show_contests<T: MedalConnection>(conn: &T, session_token: &str, ...@@ -185,7 +185,7 @@ pub fn show_contests<T: MedalConnection>(conn: &T, session_token: &str,
conn.get_contest_list() conn.get_contest_list()
.iter() .iter()
.map(|c| ContestInfo { id: c.id.unwrap(), name: c.name.clone(), duration: c.duration, public: c.public, login_required: c.requires_login.unwrap_or(false) }) .map(|c| ContestInfo { id: c.id.unwrap(), name: c.name.clone(), duration: c.duration, public: c.public, login_required: c.requires_login.unwrap_or(false) })
.filter(|ci| ci.public) .filter(|ci| ci.public || visibility == ContestVisibility::All)
.filter(|ci| ci.duration == 0 || visibility != ContestVisibility::Open) .filter(|ci| ci.duration == 0 || visibility != ContestVisibility::Open)
.filter(|ci| ci.duration != 0 || visibility != ContestVisibility::Current) .filter(|ci| ci.duration != 0 || visibility != ContestVisibility::Current)
.filter(|ci| ci.login_required || visibility != ContestVisibility::LoginRequired) .filter(|ci| ci.login_required || visibility != ContestVisibility::LoginRequired)
......
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