Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
a34c58d6
Commit
a34c58d6
authored
Oct 16, 2020
by
Robert Czechowski
Browse files
Admin interface: Separate oauth id and school id on contest export
parent
1ddf05ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/db_conn.base.rs
View file @
a34c58d6
...
...
@@ -881,6 +881,7 @@ impl MedalConnection for Connection {
"teacher_firstname"
,
"teacher_lastname"
,
"teacher_oauth_foreign_id"
,
"teacher_oauth_school_id"
,
"teacher_oauth_provider"
,
"contest_id"
,
"start_date"
];
...
...
@@ -941,6 +942,17 @@ impl MedalConnection for Connection {
for
i
in
20
..
20
+
taskgroups
.len
()
{
points
.push
(
row
.get
::
<
_
,
Option
<
i32
>>
(
i
));
}
let
teacher_oauth_and_school_id
=
row
.get
::
<
_
,
Option
<
String
>>
(
15
);
let
(
teacher_oauth_id
,
teacher_school_id
)
=
if
let
Some
(
toasi
)
=
teacher_oauth_and_school_id
{
let
mut
v
=
toasi
.split
(
'/'
);
let
oid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
let
sid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
(
oid
,
sid
)
}
else
{
(
None
,
None
)
};
// Serialized as several tuples because Serde only supports tuples up to a certain length
// (16 according to https://docs.serde.rs/serde/trait.Deserialize.html)
wtr
.serialize
(((
row
.get
::
<
_
,
i32
>
(
0
),
...
...
@@ -959,7 +971,8 @@ impl MedalConnection for Connection {
row
.get
::
<
_
,
Option
<
i32
>>
(
13
),
row
.get
::
<
_
,
Option
<
String
>>
(
14
),
row
.get
::
<
_
,
Option
<
String
>>
(
15
),
row
.get
::
<
_
,
Option
<
String
>>
(
16
),
teacher_oauth_id
,
teacher_school_id
,
row
.get
::
<
_
,
Option
<
String
>>
(
17
)),
row
.get
::
<
_
,
Option
<
i32
>>
(
18
),
row
.get
::
<
_
,
Option
<
self
::
time
::
Timespec
>>
(
19
)
...
...
src/db_conn_postgres.rs
View file @
a34c58d6
...
...
@@ -1000,6 +1000,7 @@ impl MedalConnection for Connection {
"teacher_firstname"
,
"teacher_lastname"
,
"teacher_oauth_foreign_id"
,
"teacher_oauth_school_id"
,
"teacher_oauth_provider"
,
"contest_id"
,
"start_date"
];
...
...
@@ -1060,6 +1061,17 @@ impl MedalConnection for Connection {
for
i
in
20
..
20
+
taskgroups
.len
()
{
points
.push
(
row
.get
::
<
_
,
Option
<
i32
>>
(
i
));
}
let
teacher_oauth_and_school_id
=
row
.get
::
<
_
,
Option
<
String
>>
(
15
);
let
(
teacher_oauth_id
,
teacher_school_id
)
=
if
let
Some
(
toasi
)
=
teacher_oauth_and_school_id
{
let
mut
v
=
toasi
.split
(
'/'
);
let
oid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
let
sid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
(
oid
,
sid
)
}
else
{
(
None
,
None
)
};
// Serialized as several tuples because Serde only supports tuples up to a certain length
// (16 according to https://docs.serde.rs/serde/trait.Deserialize.html)
wtr
.serialize
(((
row
.get
::
<
_
,
i32
>
(
0
),
...
...
@@ -1078,7 +1090,8 @@ impl MedalConnection for Connection {
row
.get
::
<
_
,
Option
<
i32
>>
(
13
),
row
.get
::
<
_
,
Option
<
String
>>
(
14
),
row
.get
::
<
_
,
Option
<
String
>>
(
15
),
row
.get
::
<
_
,
Option
<
String
>>
(
16
),
teacher_oauth_id
,
teacher_school_id
,
row
.get
::
<
_
,
Option
<
String
>>
(
17
)),
row
.get
::
<
_
,
Option
<
i32
>>
(
18
),
row
.get
::
<
_
,
Option
<
self
::
time
::
Timespec
>>
(
19
)
...
...
src/db_conn_sqlite_new.rs
View file @
a34c58d6
...
...
@@ -1000,6 +1000,7 @@ impl MedalConnection for Connection {
"teacher_firstname"
,
"teacher_lastname"
,
"teacher_oauth_foreign_id"
,
"teacher_oauth_school_id"
,
"teacher_oauth_provider"
,
"contest_id"
,
"start_date"
];
...
...
@@ -1060,6 +1061,17 @@ impl MedalConnection for Connection {
for
i
in
20
..
20
+
taskgroups
.len
()
{
points
.push
(
row
.get
::
<
_
,
Option
<
i32
>>
(
i
));
}
let
teacher_oauth_and_school_id
=
row
.get
::
<
_
,
Option
<
String
>>
(
15
);
let
(
teacher_oauth_id
,
teacher_school_id
)
=
if
let
Some
(
toasi
)
=
teacher_oauth_and_school_id
{
let
mut
v
=
toasi
.split
(
'/'
);
let
oid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
let
sid
:
Option
<
String
>
=
v
.next
()
.map
(|
s
|
s
.to_owned
());
(
oid
,
sid
)
}
else
{
(
None
,
None
)
};
// Serialized as several tuples because Serde only supports tuples up to a certain length
// (16 according to https://docs.serde.rs/serde/trait.Deserialize.html)
wtr
.serialize
(((
row
.get
::
<
_
,
i32
>
(
0
),
...
...
@@ -1078,7 +1090,8 @@ impl MedalConnection for Connection {
row
.get
::
<
_
,
Option
<
i32
>>
(
13
),
row
.get
::
<
_
,
Option
<
String
>>
(
14
),
row
.get
::
<
_
,
Option
<
String
>>
(
15
),
row
.get
::
<
_
,
Option
<
String
>>
(
16
),
teacher_oauth_id
,
teacher_school_id
,
row
.get
::
<
_
,
Option
<
String
>>
(
17
)),
row
.get
::
<
_
,
Option
<
i32
>>
(
18
),
row
.get
::
<
_
,
Option
<
self
::
time
::
Timespec
>>
(
19
)
...
...
Robert Czechowski
@zgtm
mentioned in issue
#119 (closed)
·
Oct 19, 2020
mentioned in issue
#119 (closed)
mentioned in issue #119
Toggle commit list
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