Skip to content

Commit

Permalink
add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
eve-git committed Sep 5, 2024
1 parent ded0beb commit ec41f8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/namex/resources/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,16 @@ def put(nr, *args, **kwargs):

# convert Expiration Date to correct format
if json_input.get('expirationDate', None):
current_app.logger.debug(f"Parsing expirationDate: {json_input['expirationDate']}")

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarCloud
try:
expirationDateStr = json_input['expirationDate']
expirationDate = DateUtils.parse_date(expirationDateStr)
# Convert the UTC datetime object to the end of day in pacific time without milliseconds
pacific_time = expirationDate.astimezone(timezone('US/Pacific'))
end_of_day_pacific = pacific_time.replace(hour=23, minute=59, second=0, microsecond=0)
json_input['expirationDate'] = end_of_day_pacific.strftime('%Y-%m-%d %H:%M:%S%z')
except Exception:
except Exception as e:
current_app.logger.debug(f"Error parsing expirationDate: {str(e)}")
pass

# convert NWPTA dates to correct format
Expand Down

0 comments on commit ec41f8d

Please sign in to comment.