[tryton-debian-vcs] tryton-server branch upstream updated. upstream/3.8.3-1-gb321873

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Mar 15 20:38:22 UTC 2016


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=upstream/3.8.3-1-gb321873

commit b3218730623cbe69252ba135e1096aed84b6fd83
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Mar 15 21:04:33 2016 +0100

    Adding upstream version 3.8.4.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 7d6c5bc..fa52ece 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 3.8.4 - 2016-03-14
+* Bug fixes (see mercurial logs for details)
+* Limit the login size in LoginAttempt
+
 Version 3.8.3 - 2016-02-06
 * Bug fixes (see mercurial logs for details)
 * Strip and unquote double-quote from Postgresql schema in search_path
diff --git a/PKG-INFO b/PKG-INFO
index c944c45..c6f2da8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.8.3
+Version: 3.8.4
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index c944c45..c6f2da8 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.8.3
+Version: 3.8.4
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond/__init__.py b/trytond/__init__.py
index 2871eed..5e7fd21 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -4,7 +4,7 @@ import os
 import time
 from email import charset
 
-__version__ = "3.8.3"
+__version__ = "3.8.4"
 
 os.environ['TZ'] = 'UTC'
 if hasattr(time, 'tzset'):
diff --git a/trytond/ir/rule.py b/trytond/ir/rule.py
index 267705b..f3dc849 100644
--- a/trytond/ir/rule.py
+++ b/trytond/ir/rule.py
@@ -117,6 +117,7 @@ class Rule(ModelSQL, ModelView):
 
         # Migration from 2.6: replace field, operator and operand by domain
         table.not_null_action('field', action='remove')
+        table.drop_fk('field')
         table.not_null_action('operator', action='remove')
         table.not_null_action('operand', action='remove')
 
diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index 0672898..068c567 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -717,7 +717,7 @@ class ModelSQL(ModelStorage):
                             _datetime=row[field.datetime_field]):
                         date_result = field.get([row['id']], cls, fname,
                             values=[row])
-                    row[field] = date_result[row['id']]
+                    row[fname] = date_result[row['id']]
             else:
                 # get the value of that field for all records/ids
                 getter_result = field.get(ids, cls, fname, values=result)
diff --git a/trytond/res/user.py b/trytond/res/user.py
index 0c4c355..7fd6f60 100644
--- a/trytond/res/user.py
+++ b/trytond/res/user.py
@@ -7,6 +7,7 @@ import random
 import hashlib
 import time
 import datetime
+from functools import wraps
 from itertools import groupby, ifilter
 from operator import attrgetter
 from ast import literal_eval
@@ -536,7 +537,7 @@ class LoginAttempt(ModelSQL):
     the res.user table when in a long running process.
     """
     __name__ = 'res.user.login.attempt'
-    login = fields.Char('Login')
+    login = fields.Char('Login', size=512)
 
     @classmethod
     def __register__(cls, module_name):
@@ -552,7 +553,14 @@ class LoginAttempt(ModelSQL):
         return (datetime.datetime.now()
             - datetime.timedelta(seconds=config.getint('session', 'timeout')))
 
+    def _login_size(func):
+        @wraps(func)
+        def wrapper(cls, login, *args, **kwargs):
+            return func(cls, login[:cls.login.size], *args, **kwargs)
+        return wrapper
+
     @classmethod
+    @_login_size
     def add(cls, login):
         cls.delete(cls.search([
                     ('create_date', '<', cls.delay()),
@@ -560,12 +568,14 @@ class LoginAttempt(ModelSQL):
         cls.create([{'login': login}])
 
     @classmethod
+    @_login_size
     def remove(cls, login):
         cursor = Transaction().cursor
         table = cls.__table__()
         cursor.execute(*table.delete(where=table.login == login))
 
     @classmethod
+    @_login_size
     def count(cls, login):
         cursor = Transaction().cursor
         table = cls.__table__()
@@ -574,6 +584,8 @@ class LoginAttempt(ModelSQL):
                 & (table.create_date >= cls.delay())))
         return cursor.fetchone()[0]
 
+    del _login_size
+
 
 class UserAction(ModelSQL):
     'User - Action'
-- 
tryton-server



More information about the tryton-debian-vcs mailing list