diff --git a/tm_admin/campaigns/api.py b/tm_admin/campaigns/api.py index 204fe2c..b9a3942 100644 --- a/tm_admin/campaigns/api.py +++ b/tm_admin/campaigns/api.py @@ -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 @@ -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 diff --git a/tm_admin/messages/api.py b/tm_admin/messages/api.py index d0ebcd8..85f4221 100755 --- a/tm_admin/messages/api.py +++ b/tm_admin/messages/api.py @@ -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 @@ -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 @@ -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 diff --git a/tm_admin/organizations/api.py b/tm_admin/organizations/api.py index 37ba51c..8034363 100644 --- a/tm_admin/organizations/api.py +++ b/tm_admin/organizations/api.py @@ -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 @@ -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 @@ -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. diff --git a/tm_admin/projects/api.py b/tm_admin/projects/api.py index 990211d..90119a3 100755 --- a/tm_admin/projects/api.py +++ b/tm_admin/projects/api.py @@ -78,7 +78,7 @@ 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. @@ -86,7 +86,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("projects") async def create(self, diff --git a/tm_admin/tasks/api.py b/tm_admin/tasks/api.py index 7e5fecf..808413d 100755 --- a/tm_admin/tasks/api.py +++ b/tm_admin/tasks/api.py @@ -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 @@ -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, diff --git a/tm_admin/users/api.py b/tm_admin/users/api.py index d1a315a..ef8a47c 100755 --- a/tm_admin/users/api.py +++ b/tm_admin/users/api.py @@ -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 @@ -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) @@ -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. @@ -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 @@ -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, diff --git a/tm_admin/users/users.py b/tm_admin/users/users.py index 308c5fb..701a9f7 100755 --- a/tm_admin/users/users.py +++ b/tm_admin/users/users.py @@ -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) @@ -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() @@ -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...")