20120603

CBSS connection

  • Moved most CBSS site-wide parameters (UserID,OrgUnit,Sector, password,…) from settings.py to SiteConfig. The SiteConfig detail has a new Tab panel “CBSS”.

  • Beim Speichern einer Tx25 wurde die NR-Nummer des Klienten nicht automatisch ins Parameterfeld eingetragen. Das war ein Bug im Framework. Lag daran, dass die person_changed zu früh ausgeführt wurde:

    INFO 20120603 StoreField.form2obj() person = u'193'
    20120603 fill_from_person 680601 053-29
    INFO 20120603 StoreField.form2obj() sent = None
    INFO 20120603 StoreField.form2obj() status = u'0'
    INFO 20120603 StoreField.form2obj() environment = u''
    INFO 20120603 StoreField.form2obj() ticket = u''
    INFO 20120603 StoreField.form2obj() request_xml = None
    INFO 20120603 StoreField.form2obj() response_xml = None
    INFO 20120603 StoreField.form2obj() logged_messages = None
    INFO 20120603 StoreField.form2obj() national_id = u''
    INFO 20120603 StoreField.form2obj() birth_date = None
    INFO 20120603 StoreField.form2obj() sis_card_no = None
    INFO 20120603 StoreField.form2obj() id_card_no = None
    INFO 20120603 StoreField.form2obj() first_name = None
    INFO 20120603 StoreField.form2obj() last_name = None
    INFO 20120603 StoreField.form2obj() language = u'de'
    INFO 20120603 StoreField.form2obj() history = u'off'
    INFO 20120603 StoreField.form2obj() user = u'1'
    INFO 20120603 StoreField.form2obj() result = None
    

    Also Store.form2obj ruft jetzt die eventuellen xxx_changed-Methoden erst auf, nachdem alle Felder des Formulars eingelesen wurden.

Schuldnerberatung

Die Verteilung au marc-le-franc (DistByBudget) fehlte noch im Ausdruck (d.h. in der Default.odt).

Auch hatte diese Tabelle am Bildschirm den falschen Titel.

Kolonnentitel von BudgetSummary fehlten (eigentlich dachte ich hier, gar keine Titel zu drucken, aber das ist noch nicht möglich.

Migrating to 1.4.4

Worked on the automatization of migrating to 1.4.4. Problem is that there are a few contracts (isip and jobs) that don’t pass the new validation rules and cause a ValidatonError “Contracts ends before it started.” These need to be adapted by the end users.

Best solution seems to change lino.utils.dumpy.DpyDeserializer so that it does not raise any exception when it says “Abandoning with %d unsaved instances from …”

on_site_config_saved

Oops, of course: now that we keep an in-memory version of the only SiteConfig instance (in lino.Lino._site_config), we must make SiteConfig.save() have this copy updated: lino.Lino.on_site_config_saved().

Budgets without actors

Oops, lino.modlib.debts didn’t yet handle the case of a budget without actors or with only one actor. But both cases make sense and are now be possible.

TODO: Should Default.odt print more information about the partner (or the single actor)?

Live tests CBSS

Bei einer Runde von live-Tests kamen noch eine ganze Serie von Kleinigkeiten zum Vorschein. Die erste war leicht:

[2012-06-03 16:18:52.532798] Traceback (most recent call last):
  File "/usr/local/django/test_dsbe/using/lino/lino/modlib/cbss/models.py", line 422, in execute_request
    retval = self.execute_request_(now,simulate_response)
  File "/usr/local/django/test_dsbe/using/lino/lino/modlib/cbss/models.py", line 548, in execute_request_
    wrapped_srvreq = self.wrap_ssdn_request(srvreq,now)
  File "/usr/local/django/test_dsbe/using/lino/lino/modlib/cbss/models.py", line 655, in wrap_ssdn_request
    au.append(E('ssdn:UserID').setText(sc.ssdn_user_id))
UnboundLocalError: local variable 'sc' referenced before assignment

Die fiesteste war eine Fehlermeldung “A validation error occurred while parsing the request header. Please check your message format and content.” Die kam durch ein leeres Feld lino.SiteConfig.site_company.email. Aber bevor ich das rausbekommen hatte, habe ich mal schnell eine Aktion validate geschrieben. Aber die hing mir dann den Server auf, weil sich lxml dann mit mod_wsgi in die Haare kriegt. Also sorry: lokales Validieren wird wohl vom Web-Client aus nicht so schnell möglich sein. Ich könnte einen management command schreiben, den man in so einem Fall von einer Shell aus aufrufen könnte. Gedacht, getan:

T:\data\luc\lino_local\dsbe>python manage.py cbss_validate_request IdentifyPersonRequest 1
Traceback (most recent call last):
  File "manage.py", line 12, in <module>
    execute_manager(settings)
  File "l:\snapshots\django\django\core\management\__init__.py", line 462, in execute_manager
    utility.execute()
  File "l:\snapshots\django\django\core\management\__init__.py", line 385, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "l:\snapshots\django\django\core\management\base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "l:\snapshots\django\django\core\management\base.py", line 231, in execute
    output = self.handle(*args, **options)
  File "t:\hgwork\lino\lino\modlib\cbss\management\commands\cbss_validate_request.py", line 31, in handle
    req.validate_request()
  File "t:\hgwork\lino\lino\modlib\cbss\models.py", line 556, in validate_request
    wrapped_srvreq = self.wrap_ssdn_request(srvreq,datetime.datetime.now())
  File "t:\hgwork\lino\lino\modlib\cbss\models.py", line 676, in wrap_ssdn_request
    au.append(E('ssdn:Email').setText(sc.site_company.email))
AttributeError: 'NoneType' object has no attribute 'email'

Schön. Stimmt: in meinem lokalen Test mit Demo-Daten ist ja sogar lino.SiteConfig.site_company momentan leer.

Daraufhin habe ich beschlossen, dass ich doch einen weiteren Konfigurationsparameter cbss_email in der SiteConfig mache.

Aber den Befehl cbss_validate_request sollten wir uns also merken für den Fall, dass mal jemand die Meldung “A validation error occurred while parsing the request header. Please check your message format and content.” kriegt.

Presto

Renamed lino.apps.luc to lino.apps.presto. This project has been sleeping a while, but now I had some inspirations… Did some database changes. New module lino.modlib.blog replaces lino.modlib.notes.

TODO: I want a view of MySessions per day, with an easy way (1 click or keystrocke) to switch back and forth between days. Currently it needs 2 clicks. Seems that a DateField with a Spinner would now be good. Like this one which was for ExtJS 2. For 3.4 there is some code on extjs-public ExtJS 4 has a Spinner field integrated. One reason to upgrade some day.

Another approach might be an EndlessTable. Endless tables have an endless series of rows (days in our case). The Detail view of my “Days” table would then have a MySessionsByDate slave grid.