chat.freenode.net #tryton log beginning Mon Nov 12 00:00:01 CET 2018 | ||
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton | 23:15 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:39 | |
-!- thaneor(~lenovo3@179.26.53.92) has joined #tryton | 00:26 | |
-!- mono2(~mono@181.137.134.104) has joined #tryton | 00:40 | |
-!- yangoon1(~mathiasb@224-75-142-46.pool.kielnet.net) has joined #tryton | 03:05 | |
-!- JanGB(~jan@ip5f5ad17c.dynamic.kabel-deutschland.de) has joined #tryton | 05:15 | |
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton | 05:55 | |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 07:59 | |
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton | 08:00 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 08:06 | |
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton | 08:11 | |
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton | 08:15 | |
semarie | on 5.0 (untested on tip), when closing tryton desktop client, I see INFO:trytond.security:logout for 'None' from '127.0.0.1' on database 'mydatabase1' in log. Shouldn't the username to be showed instead of 'None' ? | 08:36 |
---|---|---|
semarie | the other side (login) is: INFO:trytond.security:login succeeded for 'admin' from '127.0.0.1' on database 'mydatabase1' | 08:37 |
-!- rpit(~rpit@p4FD19D28.dip0.t-ipconnect.de) has joined #tryton | 08:40 | |
cedk | semarie: None is displayed when the session was already removed | 08:41 |
cedk | but 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 case | 08:54 |
semarie | I see only one logout message | 08:57 |
semarie | an option is to add user_id on logout (and login too) | 08:57 |
semarie | INFO trytond.security logout for 'None' (user_id=1) from '127.0.0.1' on database 'mydatabase1' | 08:58 |
semarie | the information is directly available (it is a parameter on logout), and it is available on login too | 08:59 |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 09:00 | |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 09:20 | |
cedk | semarie: I think it is good to have the information that logout request was not done because the session was not found | 09:21 |
semarie | cedk: I think there is a problem. here is my log (with --dev) : https://p.iotek.org/ad0 | 09:30 |
semarie | the database is fresh (sqlite) | 09:30 |
semarie | I connect using desktop, login, close the configuration tab for module, and close the desktop windows | 09:31 |
semarie | I saw the entry in ir_session table | 09:31 |
semarie | once logout it is removed | 09:31 |
semarie | from the log, there is: DELETE FROM "ir_session" WHERE (("id" IN (6))) | 09:31 |
semarie | and *after*, a SELECT for searching the session | 09:32 |
semarie | only one 'trytond.security' for logout (with None) | 09:32 |
semarie | (and these test is on tip) | 09:32 |
semarie | (and there is a little patch for showing user_id) | 09:33 |
semarie | I have the same behaviour with sao and postgresql database when clicking on "logout" icon : "logout for 'None'" | 09:40 |
semarie | with additionnal logging in ir.session, Session.remove() is called several times on logout | 09:55 |
cedk | semarie: yes I foud that too | 10:00 |
semarie | but trytond.security.logout() is called once. | 10:03 |
semarie | it might be a problem with the for loop in logout() | 10:03 |
semarie | if "name = Session.remove(session)" success, there is no break to avoid looping | 10:03 |
semarie | so first time, name="admin" and session removed | 10:04 |
semarie | and next, no more session and name=None | 10:04 |
semarie | as the logger.info is after the loop, it showed 'None' | 10:04 |
cedk | semarie: https://bugs.tryton.org/issue7852 | 10:05 |
semarie | cedk: the following diff is enough for calling Session.remove() once : https://p.iotek.org/dec | 10:07 |
semarie | it doesn't address logger.error for None | 10:07 |
semarie | ah I missed the review | 10:08 |
semarie | ACTION look at the diff | 10:08 |
semarie | cedk: 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 confusing | 10:09 |
cedk | semarie: this is free parameter from the caller so we should not care too much | 10:11 |
semarie | cedk: oh, and for login(), I think the break isn't necessary: there is already a break at end of the loop | 10:11 |
semarie | oh, you removed it | 10:12 |
cedk | semarie: yes I want to same pattern in all the metohds otherwise same issue will be happen again | 10:13 |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 10:13 | |
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton | 11:06 | |
-!- mariomop(~quassel@181.111.12.102) has joined #tryton | 11:10 | |
pokoli | i've noticed the following exception on sentry: https://pastebin.com/zXaDi9KN any idea on how to fix it? | 11:23 |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 11:59 | |
-!- thaneor1(~lenovo3@179.26.229.45) has joined #tryton | 12:29 | |
-!- JanGB(~jan@p54B05A67.dip0.t-ipconnect.de) has joined #tryton | 12:59 | |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 13:03 | |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 13:07 | |
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton | 13:28 | |
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton | 15:15 | |
-!- mariomop(~quassel@181.111.12.102) has joined #tryton | 15:39 | |
-!- lucascastro(~lucascast@177-185-139-186.isotelco.net.br) has joined #tryton | 16:09 | |
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton | 16:14 | |
-!- Sebu(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton | 17:34 | |
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton | 17:35 | |
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton | 18:24 | |
-!- andrespoliti(~andrespol@200.50.173.5) has joined #tryton | 20:12 | |
andrespoliti | good afternoon | 20:12 |
andrespoliti | how can i check the mimetype of a binary field? i'm trying to use the magic library like this: | 20:13 |
andrespoliti | mime = magic.Magic(mime=True) | 20:13 |
andrespoliti | return mime.from_buffer(buffer(dato.archivo)) | 20:13 |
andrespoliti | but it gives me an error: ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type | 20:13 |
andrespoliti | i also tried without converting to buffer, and it gives me: TypeError: decoding bytearray is not supported | 20:14 |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has left #tryton | 20:28 | |
cedk | andrespoliti: what type is magic expecting? | 20:40 |
andrespoliti | magic.from_buffer() Accepts a binary string | 20:40 |
andrespoliti | sorry, it's mime.from_buffer() | 20:41 |
cedk | andrespoliti: there is no binary string in Python | 20:47 |
andrespoliti | this is the example in the docstring of from_buffer: magic.from_buffer(open("testdata/test.pdf").read(1024)) | 20:47 |
cedk | andrespoliti: so it is string which is strange for pdf file | 20:53 |
andrespoliti | is there any other way of checking the mimetype instead of using magic? | 20:54 |
cedk | andrespoliti: the best is to be explicit so store it with data | 20:55 |
andrespoliti | i wanted to know the type to do a validation | 20:57 |
cedk | andrespoliti: can not see what validation can be done on binary data | 20:59 |
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton | 21:01 | |
andrespoliti | I'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) | 21:02 |
andrespoliti | then, when the actual workflow is executed, the system would validate that the file they uploaded is of the correct mimetype | 21:03 |
-!- Seburath_(uid331224@gateway/web/irccloud.com/x-wlhijxvqkxijxxra) has joined #tryton | 21:31 | |
cedk | andrespoliti: I guess you should make a propose to implement filters on the binary widget | 22:09 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!