in source/ecs/workspaces_helper.py [0:0]
def check_workspace_usage_for_current_month(self, last_known_user_connection_timestamp):
"""
This method returns a boolean value to indicate if the workspace was used in current month
:param: last_known_user_connection_timestamp: Last known connection timestamp
:return: returns a boolean value to indicate if the workspace was used in current month
"""
log.debug("Checking the workspace usage for the current month")
workspace_used_in_current_month = True
try:
if last_known_user_connection_timestamp is not None:
log.debug("Last know timestamp value is not None. Processing further.")
log.debug("Current month first day is {}".format(current_month_first_day))
last_known_user_connection_day = last_known_user_connection_timestamp.date()
workspace_used_in_current_month = not last_known_user_connection_day < current_month_first_day
except Exception as error:
log.error("Error occurred while checking the workspace usage for the workspace: {}".format(error))
log.debug("Returning the workspace usage in current month as {}".format(workspace_used_in_current_month))
return workspace_used_in_current_month