small fixes

This commit is contained in:
ChristopheSeux
2024-04-16 18:28:36 +02:00
parent 0055e0f39e
commit 7f60aae277
5 changed files with 37 additions and 25 deletions
+14 -13
View File
@@ -74,14 +74,14 @@ class Kitsu(Tracker):
if not gazu.client.host_is_up():
print('Error: Kitsu Host is down')
try:
print(f'Info: Log in to kitsu as {login}')
res = gazu.log_in(login, password)
LOGIN = login
print(f'Info: successfully login to Kitsu as {res["user"]["full_name"]}')
return res['user']
except Exception as e:
print(f'Error: {traceback.format_exc()}')
#try:
print(f'Info: Log in to kitsu as {login}')
res = gazu.log_in(login, password)
LOGIN = login
print(f'Info: successfully login to Kitsu as {res["user"]["full_name"]}')
return res['user']
#except Exception as e:
# print(f'Error: {traceback.format_exc()}')
def get_id(self, data):
if isinstance(data, str):
@@ -148,13 +148,14 @@ class Kitsu(Tracker):
def get_metadata_types(self, project=None):
project = self.get_project(project)
metadatas = []
for metadata in gazu.project.all_metadata_descriptors(project):
if metadata['name']:
metadatas.append(metadata)
try :
metadatas = gazu.project.all_metadata_descriptors(project)
except gazu.exception.NotAllowedException:
print('No autorized to fetch metadata')
return []
return metadatas
return [m for m in metadatas if m['name']]
def get_task_status(self, status=None):
status_id = self.get_id(status)