Enhancement/db_helper: Clean up linebreaks
Some checks failed
Test Helper Module / test (3.11.5) (push) Has been cancelled
Some checks failed
Test Helper Module / test (3.11.5) (push) Has been cancelled
This commit is contained in:
@@ -100,6 +100,7 @@ class DBHelper():
|
||||
|
||||
return cursor.fetchall()
|
||||
|
||||
|
||||
def query_breaks(self, days) -> list:
|
||||
self.__CONN = connect_config(self._config)
|
||||
self.__CONN.autocommit = True
|
||||
@@ -109,6 +110,7 @@ class DBHelper():
|
||||
|
||||
return cursor.fetchall()
|
||||
|
||||
|
||||
def query_self_callouts(self, user_id: int, days: int = 365):
|
||||
self.__CONN = connect_config(self._config)
|
||||
self.__CONN.autocommit = True
|
||||
@@ -137,6 +139,7 @@ class DBHelper():
|
||||
|
||||
return
|
||||
|
||||
|
||||
def add_break(self, user_id: int, break_start: datetime.date, break_end: datetime.date) -> None:
|
||||
|
||||
self.__CONN = connect_config(self._config)
|
||||
@@ -209,17 +212,18 @@ class DBHelper():
|
||||
# is_range boolean
|
||||
if entry[1] == True:
|
||||
# if it is a range, format as a range
|
||||
output += f' • Break range: {entry[2]} until... '
|
||||
output += f' • Break from: {entry[2]} until... '
|
||||
|
||||
else:
|
||||
# if it is not a range, format as a single date
|
||||
output += f' • Break date: {entry[2]}'
|
||||
output += f' • We are taking a break on: {entry[2]}'
|
||||
|
||||
if item == 2:
|
||||
if entry[1] == True:
|
||||
output += f'{entry[3]}.\n'
|
||||
else:
|
||||
output += '\n'
|
||||
|
||||
output += "END OF MESSAGE"
|
||||
return output
|
||||
|
||||
|
||||
Reference in New Issue
Block a user