[API/Librus] Fix indicating parent account during first login.

This commit is contained in:
Kuba Szczodrzyński 2020-03-13 16:37:30 +01:00
parent 7c7dff743b
commit 4480a7e486

View File

@ -54,6 +54,8 @@ class LibrusFirstLogin(val data: DataLibrus, val onSuccess: () -> Unit) {
return@portalGet
}
val isParent = account.getString("group") == "parent"
val id = account.getInt("id") ?: continue
val login = account.getString("login") ?: continue
val token = account.getString("accessToken") ?: continue
@ -69,7 +71,7 @@ class LibrusFirstLogin(val data: DataLibrus, val onSuccess: () -> Unit) {
data.portalEmail,
studentNameLong,
studentNameShort,
null
if (isParent) studentNameLong else null /* temporarily - there is no parent name provided, only the type */
).apply {
studentData["accountId"] = id
studentData["accountLogin"] = login