IRC logs of #tryton for Monday, 2018-11-12 #tryton log beginning Mon Nov 12 00:00:01 CET 2018
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton00:11
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:11
-!- thaneor(~lenovo3@ has joined #tryton01:11
-!- mono2(~mono@ has joined #tryton01:11
-!- yangoon1( has joined #tryton04:11
-!- JanGB( has joined #tryton06:11
-!- tafelgeschirr(~tafelgesc@ has joined #tryton06:11
-!- Timitos( has joined #tryton08:11
-!- mrichez( has joined #tryton09:11
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:11
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton09:11
-!- udono( has joined #tryton09:11
semarieon 5.0 (untested on tip), when closing tryton desktop client, I see for 'None' from '' on database 'mydatabase1' in log. Shouldn't the username to be showed instead of 'None' ?09:11
semariethe other side (login) is: succeeded for 'admin' from '' on database 'mydatabase1'09:11
-!- rpit( has joined #tryton09:11
cedksemarie: None is displayed when the session was already removed09:11
cedkbut it will be good to investigate if there are no two logout request and also I think the log message should be better in this case09:11
semarieI see only one logout message09:11
semariean option is to add user_id on logout (and login too)09:11
semarie  INFO logout for 'None' (user_id=1) from '' on database 'mydatabase1'09:11
semariethe information is directly available (it is a parameter on logout), and it is available on login too09:11
-!- nicoe( has joined #tryton10:11
-!- nicoe( has joined #tryton10:11
cedksemarie: I think it is good to have the information that logout request was not done because the session was not found10:11
semariecedk: I think there is a problem. here is my log (with --dev) :
semariethe database is fresh (sqlite)10:11
semarieI connect using desktop, login, close the configuration tab for module, and close the desktop windows10:11
semarieI saw the entry in ir_session table10:11
semarieonce logout it is removed10:11
semariefrom the log, there is: DELETE FROM "ir_session" WHERE (("id" IN (6)))10:11
semarieand *after*, a SELECT for searching the session10:11
semarieonly one '' for logout (with None)10:11
semarie(and these test is on tip)10:11
semarie(and there is a little patch for showing user_id)10:11
semarieI have the same behaviour with sao and postgresql database when clicking on "logout" icon : "logout for 'None'"10:11
semariewith additionnal logging in ir.session, Session.remove() is called several times on logout10:11
cedksemarie: yes I foud that too11:11
semariebut is called once.11:11
semarieit might be a problem with the for loop in logout()11:11
semarieif "name = Session.remove(session)" success, there is no break to avoid looping11:11
semarieso first time, name="admin" and session removed11:11
semarieand next, no more session and name=None11:11
semarieas the is after the loop, it showed 'None'11:11
semariecedk: the following diff is enough for calling Session.remove() once :
semarieit doesn't address logger.error for None11:11
semarieah I missed the review11:11
semarieACTION look at the diff11:11
semariecedk: the "logout failed" message should be different as it isn't a logname that is used but a user_id. else if someone create a user with '1' as logname it will be confusing11:11
cedksemarie: this is free parameter from the caller so we should not care too much11:11
semariecedk: oh, and for login(), I think the break isn't necessary: there is already a break at end of the loop11:11
semarieoh, you removed it11:11
cedksemarie: yes I want to same pattern in all the metohds otherwise same issue will be happen again11:11
-!- nicoe( has joined #tryton11:11
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton12:11
-!- mariomop(~quassel@ has joined #tryton12:11
pokolii've noticed the following exception on sentry: any idea on how to fix it?12:11
-!- nicoe( has joined #tryton12:11
-!- thaneor1(~lenovo3@ has joined #tryton13:11
-!- JanGB( has joined #tryton13:11
-!- nicoe( has joined #tryton14:11
-!- nicoe( has joined #tryton14:11
-!- mrichez( has joined #tryton14:11
-!- tafelgeschirr(~tafelgesc@ has joined #tryton16:11
-!- mariomop(~quassel@ has joined #tryton16:11
-!- lucascastro( has joined #tryton17:11
-!- Seburath(bf649377@gateway/web/freenode/ip. has joined #tryton17:11
-!- Sebu(bf649377@gateway/web/freenode/ip. has joined #tryton18:11
-!- Seburath(bf649377@gateway/web/freenode/ip. has joined #tryton18:11
-!- udono( has joined #tryton19:11
-!- andrespoliti(~andrespol@ has joined #tryton21:11
andrespolitigood afternoon21:11
andrespolitihow can i check the mimetype of a binary field? i'm trying to use the magic library like this:21:11
andrespolitimime = magic.Magic(mime=True)21:11
andrespolitireturn mime.from_buffer(buffer(dato.archivo))21:11
andrespolitibut it gives me an error: ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type21:11
andrespolitii also tried without converting to buffer, and it gives me: TypeError: decoding bytearray is not supported21:11
-!- Timitos( has left #tryton21:11
cedkandrespoliti: what type is magic expecting?21:11
andrespolitimagic.from_buffer() Accepts a binary string21:11
andrespolitisorry, it's mime.from_buffer()21:11
cedkandrespoliti: there is no binary string in Python21:11
andrespolitithis is the example in the docstring of from_buffer: magic.from_buffer(open("testdata/test.pdf").read(1024))21:11
cedkandrespoliti: so it is string which is strange for pdf file21:11
andrespolitiis there any other way of checking the mimetype instead of using magic?21:11
cedkandrespoliti: the best is to be explicit so store it with data21:11
andrespolitii wanted to know the type to do a validation21:11
cedkandrespoliti: can not see what validation can be done on binary data21:11
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton22:11
andrespolitiI'm making an user configurable workflow system, and in each step they can configure required data. If the data is of type 'file', they can select the type of file (image, audio, pdf, etc)22:11
andrespolitithen, when the actual workflow is executed, the system would validate that the file they uploaded is of the correct mimetype22:11
-!- Seburath_(uid331224@gateway/web/ has joined #tryton22:11
cedkandrespoliti: I guess you should make a propose to implement filters on the binary widget23:11

Generated by 2.16.0 by Marius Gedminas - find it at!