linuxmuster / sophomorix4

sophomorix for Samba 4
GNU General Public License v3.0
7 stars 7 forks source link

JSON Output incoherent in case of duplicate identifier #162

Closed PLanB2008 closed 1 year ago

PLanB2008 commented 2 years ago

See here:

https://ask.linuxmuster.net/t/webui-fehlermeldung-bei-doppelten-eintraegen/9319/2

When a user is twice in an import file the error is put in [OUTPUT]

Webui assumes to find a [CHECK_RESULT] tree

PLanB2008 commented 2 years ago

Friendly Reminder :)

PLanB2008 commented 1 year ago

And Again

jeffbeck commented 1 year ago

There are multiple cases that could be named as "User is twice in a file"

1) If a LINE is double, like

7a;Jackson;mike;10.10.1998;
7a;Jackson;mike;10.10.1998;

sophomorix accepts the line unconditionally without warning, without error

2) If a USER is double, but in different classes, like

7a;Jackson;mike;10.10.1998;
8a;Jackson;mike;10.10.1998;

sophomorix cannot solve this dispute and ignores both lines -> JSON -> OUTPUT -> TYPE=WARNING

MESSAGE_DE: Identifier Jackson;mike;10.10.1998 seen 2 times in school default-school: FILE:students.csv|CLASS:7a,FILE:students.csv|CLASS:8a (please fix this in your files)"

-> The admin has to fix this Problem, or just wait. On our Berufsschule one student might have applied to two different types of schools/classes. When the student comes in person to the school, he/she is deleted from one class and is then added automatically to the correct class

The best is to wait, so just a WARNING

3) If a schoolsoftware ID(Field 5 in students.csv) is double, like

7a;Jackson;mike;10.10.1998;12345673
8a;Jackson;mike;10.10.1998;12345673

Then there ist ALWAYS trouble ahead. USERs cannot have the same ID neither in linuxmuster.net nor in schooladministration software so there is a -> JSON -> OUTPUT -> TYPE=ERROR with programm exit

"students.csv (Line: 2): Unid (Field5) is double: 123456 "

sophomorix exits with ERROR because this problem does not solve itself. The admin has to take action. Deleting the 2 lines (with an editor) makes sophomorix run again without this users

Maybe you want me to treat 3) like 2)? Just a warning, ignore the lines with the same ID?

I think its better to exit with ERROR. This problem cannot be fixed without troubleshooting.