Bug 37776 - Whitespace in birthday is not shown as error
Whitespace in birthday is not shown as error
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - CSV Import
UCS@school 4.0
Other Linux
: P5 normal (vote)
: UCS@school 4.0 Errata
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
Depends on:
Blocks: 37777
  Show dependency treegraph
 
Reported: 2015-02-11 15:55 CET by Sönke Schwardt-Krummrich
Modified: 2015-02-27 15:19 CET (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
patch (840 bytes, patch)
2015-02-20 11:48 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2015-02-11 15:55:55 CET
The CSV import module does not indicate some whitespaces in date strings as error.
E.g. the birthdates "1991 -01-01", "1991-01 -01" and "1988. 4.21" are shown as valid date in the grid (no red highlighting) but are rejected by/cause errors during the import later on. Additionally the javascript date selector does not recognize the date and shows an empty field.

This affects U@S 3.2R2 and U@S 4.0.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2015-02-12 17:45:20 CET
r57987 | Bug #37776: remove whitespace from birthday date strings

ucs-school-umc-csv-import (2.0.3-2) unstable; urgency=low

Changelog entry has been added
Comment 2 Florian Best univentionstaff 2015-02-20 11:48:19 CET
Die Ausführung des Kommandos schoolcsvimport/progress ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/__init__.py", line 176, in _decorated
    return function(self, request, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 316, in _response
    result = _multi_response(self, request)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 460, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 282, in _fake_func
    yield function(self, *args)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 307, in _thread
    result = _multi_response(self, request)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 460, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 282, in _fake_func
    yield function(self, *args)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolcsvimport/__init__.py", line 283, in show
    result['users'] = [user.to_dict(file_info.date_format) for user in users]
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolcsvimport/util.py", line 207, in to_dict
    attrs['birthday'] = format_date(attrs['birthday'].replace(' ', ''), format_birthday)
AttributeError: 'NoneType' object has no attribute 'replace'
Comment 3 Florian Best univentionstaff 2015-02-20 11:48:31 CET
Created attachment 6705 [details]
patch
Comment 4 Florian Best univentionstaff 2015-02-20 15:21:48 CET
I applied that patch.
Comment 5 Florian Best univentionstaff 2015-02-20 15:35:38 CET
Fix: OK
Changelog: OK
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2015-02-20 17:19:29 CET
(In reply to Florian Best from comment #4)
> I applied that patch.

Patch is ok. Btw: how did you trigger the traceback?
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2015-02-27 15:19:43 CET
UCS@school 4.0 v2 has been released:
http://docs.univention.de/release-notes-ucsschool-4.0v2-de.html

If this error occurs again, please use "Clone This Bug".