cornflow 1.1.2__py3-none-any.whl → 1.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,7 @@ class LoginBaseEndpoint(BaseMetaResource):
34
34
  """
35
35
  Base endpoint to perform a login action from a user
36
36
  """
37
+
37
38
  def __init__(self):
38
39
  super().__init__()
39
40
  self.ldap_class = LDAPBase
@@ -102,7 +103,9 @@ class LoginBaseEndpoint(BaseMetaResource):
102
103
  raise InvalidCredentials()
103
104
  user = self.data_model.get_one_object(username=username)
104
105
  if not user:
105
- current_app.logger.info(f"LDAP user {username} does not exist and is created")
106
+ current_app.logger.info(
107
+ f"LDAP user {username} does not exist and is created"
108
+ )
106
109
  email = ldap_obj.get_user_email(username)
107
110
  if not email:
108
111
  email = ""
@@ -122,10 +125,14 @@ class LoginBaseEndpoint(BaseMetaResource):
122
125
 
123
126
  except IntegrityError as e:
124
127
  db.session.rollback()
125
- current_app.logger.error(f"Integrity error on user role assignment on log in: {e}")
128
+ current_app.logger.error(
129
+ f"Integrity error on user role assignment on log in: {e}"
130
+ )
126
131
  except DBAPIError as e:
127
132
  db.session.rollback()
128
- current_app.logger.error(f"Unknown error on user role assignment on log in: {e}")
133
+ current_app.logger.error(
134
+ f"Unknown error on user role assignment on log in: {e}"
135
+ )
129
136
 
130
137
  return user
131
138
 
@@ -163,7 +170,9 @@ class LoginBaseEndpoint(BaseMetaResource):
163
170
  user = self.data_model.get_one_object(username=username)
164
171
 
165
172
  if not user:
166
- current_app.logger.info(f"OpenID user {username} does not exist and is created")
173
+ current_app.logger.info(
174
+ f"OpenID user {username} does not exist and is created"
175
+ )
167
176
 
168
177
  data = {"username": username, "email": username}
169
178
 
@@ -183,7 +192,11 @@ class LoginBaseEndpoint(BaseMetaResource):
183
192
 
184
193
  def check_last_password_change(user):
185
194
  if user.pwd_last_change:
186
- if user.pwd_last_change + timedelta(days=int(current_app.config["PWD_ROTATION_TIME"])) < datetime.utcnow():
195
+ if (
196
+ user.pwd_last_change
197
+ + timedelta(days=int(current_app.config["PWD_ROTATION_TIME"]))
198
+ < datetime.utcnow()
199
+ ):
187
200
  return True
188
201
  return False
189
202
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cornflow
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: Cornflow is an open source multi-solver optimization server with a REST API built using flask.
5
5
  Home-page: https://github.com/baobabsoluciones/cornflow
6
6
  Author: baobab soluciones
@@ -49,7 +49,7 @@ cornflow/endpoints/execution.py,sha256=5SWwgbxBUj_gDU6Yb7Z-iKNakr9vr3g5qU82Bw9y5
49
49
  cornflow/endpoints/health.py,sha256=TWmWjKdQOoDzpqwcfksuaAGOLIb2idxzPQcGMWrdkCY,1610
50
50
  cornflow/endpoints/instance.py,sha256=WAnloocXFxSW4vunBJo3CIHx4NzC_0GPJh5bj3ETd9U,11615
51
51
  cornflow/endpoints/licenses.py,sha256=82hHWGYvVIiyw9mlwGtMwJMDJ-ShHOi9rvuM6KvfE4U,873
52
- cornflow/endpoints/login.py,sha256=HMPBQm_yEBzPCvBU_UHlOkUYgtWJG5rL9euR8Dzxm0w,7864
52
+ cornflow/endpoints/login.py,sha256=Gaqhlrno6XGcZ0z3uVqPM61r2DUP_xGlfY62R-MDRqA,8033
53
53
  cornflow/endpoints/main_alarms.py,sha256=GUB-UdnvEFi7n6FGFKO9VtZeZb4Ox3NvBMhB7rdqNyI,2006
54
54
  cornflow/endpoints/meta_resource.py,sha256=eqC6U8IpY65Cbk2WpdphRtE6o5kes2lB4LhezfUB7xI,8471
55
55
  cornflow/endpoints/permission.py,sha256=FpEBIucfUl89UaJ80SC0VR6pFAdqdSsS43SdNkcXWtI,3751
@@ -168,8 +168,8 @@ cornflow/tests/unit/test_tables.py,sha256=dY55YgaCkyqwJnqn0LbZHNeXBoL4ZxXWwKkCoT
168
168
  cornflow/tests/unit/test_token.py,sha256=OEVPgG8swSMkUbuGJGfGF5Z27utMLICn1eIyma1cM9E,3760
169
169
  cornflow/tests/unit/test_users.py,sha256=WfaMcybPpR7rspXyvzHGgw25p751hMPAV0DOp_caSPM,22430
170
170
  cornflow/tests/unit/tools.py,sha256=ag3sWv2WLi498R1GL5AOUnXqSsszD3UugzLZLC5NqAw,585
171
- cornflow-1.1.2.dist-info/METADATA,sha256=DX4tFKqUVqnDQxwKGk097ZLgwjRP4BIkovhefRLZi3A,9366
172
- cornflow-1.1.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
173
- cornflow-1.1.2.dist-info/entry_points.txt,sha256=r5wKLHpuyVLMUIZ5I29_tpqYf-RuP-3w_8DhFi8_blQ,47
174
- cornflow-1.1.2.dist-info/top_level.txt,sha256=Qj9kLFJW1PLb-ZV2s_aCkQ-Wi5W6KC6fFR-LTBrx-rU,24
175
- cornflow-1.1.2.dist-info/RECORD,,
171
+ cornflow-1.1.4.dist-info/METADATA,sha256=Ot3twWFOpS17sPtCpCSSe5zaMyInewnCTZlMYtwxatA,9366
172
+ cornflow-1.1.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
173
+ cornflow-1.1.4.dist-info/entry_points.txt,sha256=r5wKLHpuyVLMUIZ5I29_tpqYf-RuP-3w_8DhFi8_blQ,47
174
+ cornflow-1.1.4.dist-info/top_level.txt,sha256=Qj9kLFJW1PLb-ZV2s_aCkQ-Wi5W6KC6fFR-LTBrx-rU,24
175
+ cornflow-1.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5