@@ 367-382 (lines=16) @@ | ||
364 | cursor.execute(query, (cookie_dict.get('user_uuid'), cookie_dict.get('token'),)) |
|
365 | row = cursor.fetchone() |
|
366 | ||
367 | if row is None: |
|
368 | if cursor: |
|
369 | cursor.close() |
|
370 | if cnx: |
|
371 | cnx.disconnect() |
|
372 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
373 | description='API.INVALID_SESSION_PLEASE_RE_LOGIN') |
|
374 | else: |
|
375 | utc_expires = row[0] |
|
376 | if datetime.utcnow() > utc_expires: |
|
377 | if cursor: |
|
378 | cursor.close() |
|
379 | if cnx: |
|
380 | cnx.disconnect() |
|
381 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
382 | description='API.USER_SESSION_TIMEOUT') |
|
383 | ||
384 | cursor.execute(" SELECT id " |
|
385 | " FROM tbl_users " |
|
@@ 285-300 (lines=16) @@ | ||
282 | cursor.execute(query, (cookie_dict.get('user_uuid'), cookie_dict.get('token'),)) |
|
283 | row = cursor.fetchone() |
|
284 | ||
285 | if row is None: |
|
286 | if cursor: |
|
287 | cursor.close() |
|
288 | if cnx: |
|
289 | cnx.disconnect() |
|
290 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
291 | description='API.INVALID_SESSION_PLEASE_RE_LOGIN') |
|
292 | else: |
|
293 | utc_expires = row[0] |
|
294 | if datetime.utcnow() > utc_expires: |
|
295 | if cursor: |
|
296 | cursor.close() |
|
297 | if cnx: |
|
298 | cnx.disconnect() |
|
299 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
300 | description='API.USER_SESSION_TIMEOUT') |
|
301 | ||
302 | cursor.execute(" SELECT id " |
|
303 | " FROM tbl_users " |
|
@@ 184-199 (lines=16) @@ | ||
181 | cursor.execute(query, (cookie_dict.get('user_uuid'), cookie_dict.get('token'),)) |
|
182 | row = cursor.fetchone() |
|
183 | ||
184 | if row is None: |
|
185 | if cursor: |
|
186 | cursor.close() |
|
187 | if cnx: |
|
188 | cnx.disconnect() |
|
189 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
190 | description='API.INVALID_SESSION_PLEASE_RE_LOGIN') |
|
191 | else: |
|
192 | utc_expires = row[0] |
|
193 | if datetime.utcnow() > utc_expires: |
|
194 | if cursor: |
|
195 | cursor.close() |
|
196 | if cnx: |
|
197 | cnx.disconnect() |
|
198 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
199 | description='API.USER_SESSION_TIMEOUT') |
|
200 | ||
201 | cursor.execute(" SELECT id " |
|
202 | " FROM tbl_users " |
|
@@ 77-92 (lines=16) @@ | ||
74 | cursor.execute(query, (cookie_dict.get('user_uuid'), cookie_dict.get('token'),)) |
|
75 | row = cursor.fetchone() |
|
76 | ||
77 | if row is None: |
|
78 | if cursor: |
|
79 | cursor.close() |
|
80 | if cnx: |
|
81 | cnx.disconnect() |
|
82 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
83 | description='API.INVALID_SESSION_PLEASE_RE_LOGIN') |
|
84 | else: |
|
85 | utc_expires = row[0] |
|
86 | if datetime.utcnow() > utc_expires: |
|
87 | if cursor: |
|
88 | cursor.close() |
|
89 | if cnx: |
|
90 | cnx.disconnect() |
|
91 | raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', |
|
92 | description='API.USER_SESSION_TIMEOUT') |
|
93 | ||
94 | cursor.execute(" SELECT id " |
|
95 | " FROM tbl_users " |