Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
medal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
39
Issues
39
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bwinf
medal
Commits
4d5af089
Commit
4d5af089
authored
Jul 07, 2020
by
Robert Czechowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin page: Contest export: Export into file: Generate file
parent
e28a06dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
src/core.rs
src/core.rs
+3
-3
src/helpers.rs
src/helpers.rs
+2
-0
No files found.
src/core.rs
View file @
4d5af089
...
...
@@ -1288,11 +1288,11 @@ pub fn admin_contest_export<T: MedalConnection>(conn: &T, contest_id: i32, sessi
let
taskgroup_ids
:
Vec
<
(
i32
,
String
)
>
=
contest
.taskgroups
.into_iter
()
.map
(|
tg
|
(
tg
.id
.unwrap
(),
tg
.name
))
.collect
();
let
filename
=
"./export/blub.csv"
;
let
filename
=
format!
(
"contest_{}__{}__{}.csv"
,
contest_id
,
self
::
time
::
strftime
(
"%F_%H-%M-%S"
,
&
self
::
time
::
now
())
.unwrap
(),
helpers
::
make_filename_secret
())
;
let
contest
=
conn
.export_contest_results_to_file
(
contest_id
,
&
taskgroup_ids
,
filename
);
conn
.export_contest_results_to_file
(
contest_id
,
&
taskgroup_ids
,
&
format!
(
"./export/{}"
,
filename
)
);
Ok
(
"blub.csv"
.to_string
()
)
Ok
(
filename
)
}
#[derive(PartialEq)]
...
...
src/helpers.rs
View file @
4d5af089
...
...
@@ -25,6 +25,8 @@ pub fn make_csrf_token() -> String { thread_rng().sample_iter(&Alphanumeric).tak
pub
fn
make_salt
()
->
String
{
thread_rng
()
.sample_iter
(
&
Alphanumeric
)
.take
(
10
)
.collect
()
}
pub
fn
make_filename_secret
()
->
String
{
thread_rng
()
.sample_iter
(
&
Alphanumeric
)
.take
(
10
)
.collect
()
}
pub
fn
make_group_code
()
->
String
{
Some
(
'g'
)
.into_iter
()
.chain
(
thread_rng
()
.sample_iter
(
&
Alphanumeric
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment