diff -r 62877abb8ef0 webtranslate/users/redmine.py --- a/webtranslate/users/redmine.py Fri Dec 23 14:39:42 2016 +0100 +++ b/webtranslate/users/redmine.py Mon Jan 08 19:08:25 2018 +0100 @@ -118,20 +118,21 @@ @param parms: Parameters of the command. @type parms: C{tuple} of C{str} @return: Cursor with the result, if all went well, else C{None} @rtype: db cursor, or C{None} """ global db_type, db_schema, db_name, db_password, db_user, db_host, db_port, db_connection if db_type == 'postgress': + import psycopg2 cur = db_connection.cursor() try: cur.execute(cmd, parms) return cur except psycopg2.OperationalError: # Administrator closed the connection. db_connection = None return None else: