Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: Update comment block for issue mkdocs found
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Mar 6, 2024
1 parent 7a23f87 commit 09bab8a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 37 deletions.
8 changes: 4 additions & 4 deletions tm_admin/campaigns/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self):
super().__init__("campaigns")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require
Expand All @@ -89,19 +89,19 @@ async def initialize(self,
#await self.teamsdb.connect(uri)

async def getByID(self,
org_id: int,
campaign_id: int,
):
"""
Get all the information for an campaign using it's ID
Args:
project_id (int): The campaign to get the data for
campaign_id (int): The campaign to get the data for
Returns:
(dict): the campaign information
"""
# log.debug(f"--- getByID() ---")
sql = f"SELECT * FROM campaigns WHERE id={org_id}"
sql = f"SELECT * FROM campaigns WHERE id={campaign_id}"
results = await self.execute(sql)
return results

Expand Down
10 changes: 5 additions & 5 deletions tm_admin/messages/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):
super().__init__("campaigns")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require
Expand All @@ -82,19 +82,19 @@ async def initialize(self,
Args:
inuri (str): The URI for the TM Admin output database
"""
await self.connect(uri)
await self.connect(inuri)
await self.getTypes("messages")
#await self.usersdb.connect(uri)
#await self.teamsdb.connect(uri)

async def getByID(self,
org_id: int,
message_id: int,
):
"""
Get all the information for an message using it's ID
Args:
project_id (int): The message to get the data for
message_id (int): The message to get the data for
Returns:
(dict): the message information
Expand Down Expand Up @@ -166,7 +166,7 @@ async def delete(self,
Delete messages from the database.
Args:
message_id (list): The messages
message_ids (list): The messages
Returns:
(bool): Whether the messages got deleted
Expand Down
6 changes: 3 additions & 3 deletions tm_admin/organizations/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self):
super().__init__("organizations")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require
Expand All @@ -84,7 +84,7 @@ async def getByID(self,
Get all the information for an organization using it's ID
Args:
project_id (int): The organization to get the data for
org_id (int): The organization to get the data for
Returns:
(dict): the organization information
Expand Down Expand Up @@ -133,7 +133,7 @@ async def create(self,
return False

async def update(self,
org: OrganizationsTable,
organization: OrganizationsTable,
):
"""
Update a organization that is already in the database.
Expand Down
4 changes: 2 additions & 2 deletions tm_admin/projects/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def __init__(self):
super().__init__("projects")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require accessing multiple tables.
Args:
inuri (str): The URI for the TM Admin output database
"""
await self.connect(uri)
await self.connect(inuri)
await self.getTypes("projects")

async def create(self,
Expand Down
4 changes: 2 additions & 2 deletions tm_admin/tasks/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self):
super().__init__("tasks")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require
Expand All @@ -77,7 +77,7 @@ async def initialize(self,
Args:
inuri (str): The URI for the TM Admin output database
"""
await self.connect(uri)
await self.connect(inuri)
await self.getTypes("tasks")

async def getStatus(self,
Expand Down
22 changes: 4 additions & 18 deletions tm_admin/users/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self):
super().__init__("users")

async def initialize(self,
uri: str,
inuri: str,
):
"""
Connect to all tables for API endpoints that require
Expand All @@ -77,7 +77,7 @@ async def initialize(self,
Args:
inuri (str): The URI for the TM Admin output database
"""
await self.connect(uri)
await self.connect(inuri)
await self.getTypes("users")
#await self.messagesdb.connect(uri)
#await self.usersdb.connect(uri)
Expand Down Expand Up @@ -105,7 +105,7 @@ async def create(self,
return False

async def update(self,
org: UsersTable,
user: UsersTable,
):
"""
Update a user that is already in the database.
Expand All @@ -125,7 +125,7 @@ async def delete(self,
Delete a user from the database.
Args:
user_id (int): The user's ID
user_ids (int): The user's ID
Returns:
(bool): Whether the user got deleted
Expand Down Expand Up @@ -202,20 +202,6 @@ async def getBlocked(self,
else:
return False

async def updateRole(self,
id: int,
# role: Userrole,
):
"""
Update the role for a user.
Args:
id (int): The users ID
role (Userrole): The new role.
"""
# role = Userrole(role)
# return self.updateColumn(id, {'role': role.name})

async def updateMappingLevel(self,
id: int,
level: Mappinglevel,
Expand Down
6 changes: 3 additions & 3 deletions tm_admin/users/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def interestsThread(
"""Thread to handle importing
Args:
data (list): The list of records to import
interests (list): The list of records to import
db (PostgresClient): A database connection
"""
pbar = tqdm.tqdm(interests)
Expand All @@ -84,7 +84,7 @@ async def favoritesThread(
"""Thread to handle importing favorites
Args:
data (list): The list of records to import
favorites (list): The list of records to import
db (PostgresClient): A database connection
"""
data = dict()
Expand Down Expand Up @@ -184,7 +184,7 @@ async def mergeLicenses(self,
into a new temporary table and then renaming it.
Args:
inturi (str): The input database
inpg (PostgresClient): The input database
"""
table = 'user_licenses'
# log.info(f"Merging licenses table...")
Expand Down

0 comments on commit 09bab8a

Please sign in to comment.