Skip to content

Commit

Permalink
2 logo 2 sign issue fixed in project certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
thippeswamy123-ship-it committed Feb 8, 2024
1 parent e28adfa commit 3ae0c41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions common_config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ themerubricuploadapiurl = api/private/mlsurvey/v1/solutions/uploadThemesRubricEx
importsurveysolutiontemplateurl = api/private/mlsurvey/v1/surveys/importSurveryTemplateToSolution/
importsurveysolutiontoprogramurl = api/private/mlsurvey/v1/surveys/mapSurverySolutionToProgram/
solutiontoprogrammappingapiurl = api/private/mlsurvey/v1/solutions/importFromSolution
fetchprograminfoapiurl = api/private/mlcore/v1/programs/list?page=1&limit=1000&search=
fetchprograminfoapiurl = private/mlcore/api/v1/admin/dbFind/programs
fetchsolutiondetails = api/private/mlcore/v1/solutions/list?type=
frameworkcreationapi = api/private/mlsurvey/v1/frameworks/create
solutionupdateapi = api/private/mlcore/v1/solutions/update/
Expand Down Expand Up @@ -77,7 +77,7 @@ themerubricuploadapiurl = api/private/mlsurvey/v1/solutions/uploadThemesRubricEx
importsurveysolutiontemplateurl = api/private/mlsurvey/v1/surveys/importSurveryTemplateToSolution/
importsurveysolutiontoprogramurl = api/private/mlsurvey/v1/surveys/mapSurverySolutionToProgram/
solutiontoprogrammappingapiurl = api/private/mlsurvey/v1/solutions/importFromSolution
fetchprograminfoapiurl = api/private/mlcore/v1/programs/list?page=1&limit=10000&search=
fetchprograminfoapiurl = private/mlcore/api/v1/admin/dbFind/programs
fetchsolutiondetails = api/private/mlcore/v1/solutions/list?type=
frameworkcreationapi = api/private/mlsurvey/v1/frameworks/create
solutionupdateapi = api/private/mlcore/v1/solutions/update/
Expand Down
22 changes: 15 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def programsFileCheck(filePathAddPgm, accessToken, parentFolder, MainFilePath):
Programmappingapicall(MainFilePath, accessToken, program_file,parentFolder)

# check if program is created or not
if getProgramInfo(accessToken, parentFolder, extIdPGM):
if getProgramInfo(accessToken, parentFolder, programNameInp):
print("Program Created SuccessFully.")
else :
terminatingMessage("Program creation failed! Please check logs.")
Expand Down Expand Up @@ -684,13 +684,21 @@ def generateAccessToken(solutionName_for_folder_path):
def getProgramInfo(accessTokenUser, solutionName_for_folder_path, programNameInp):
global programID, programExternalId, programDescription, isProgramnamePresent, programName
programName = programNameInp
programUrl = config.get(environment, 'INTERNAL_KONG_IP') + config.get(environment, 'fetchProgramInfoApiUrl') + programNameInp.lstrip().rstrip()
programUrl = config.get(environment, 'INTERNAL_KONG_IP') + config.get(environment, 'fetchProgramInfoApiUrl')
print(programUrl)
payload = json.dumps({
"query": {
"name": programNameInp.lstrip().rstrip(),
"isAPrivateProgram": False,
"status": "active"
},
"mongoIdKeys": []
})

headersProgramSearch = {'Authorization': config.get(environment, 'Authorization'),
'Content-Type': 'application/json', 'X-authenticated-user-token': accessTokenUser,
'internal-access-token': config.get(environment, 'internal-access-token')}
responseProgramSearch = requests.post(url=programUrl, headers=headersProgramSearch)
responseProgramSearch = requests.post(url=programUrl, headers=headersProgramSearch,data=payload)
print(responseProgramSearch.text)
messageArr = []

Expand All @@ -704,7 +712,7 @@ def getProgramInfo(accessTokenUser, solutionName_for_folder_path, programNameInp
print('--->Program fetch API Success')
messageArr.append("--->Program fetch API Success")
responseProgramSearch = responseProgramSearch.json()
countOfPrograms = len(responseProgramSearch['result']['data'])
countOfPrograms = len(responseProgramSearch['result'])
messageArr.append("--->Program Count : " + str(countOfPrograms))
if countOfPrograms == 0:
messageArr.append("No program found with the name : " + str(programName.lstrip().rstrip()))
Expand All @@ -717,7 +725,7 @@ def getProgramInfo(accessTokenUser, solutionName_for_folder_path, programNameInp
return False
else:
getProgramDetails = []
for eachPgm in responseProgramSearch['result']['data']:
for eachPgm in responseProgramSearch['result']:
if eachPgm['isAPrivateProgram'] == False:
programID = eachPgm['_id']
programExternalId = eachPgm['externalId']
Expand Down Expand Up @@ -4842,7 +4850,7 @@ def downloadlogosign(filePathAddProject,projectName_for_folder_path):
signature1 = gdown.download(file_url, dest_file, quiet=False)

Authsign2 = dictDetailsEnv['Authorised Signature Image - 2']
logo_split = str(Authsign1).split('/')[5]
logo_split = str(Authsign2).split('/')[5]

file_url = 'https://drive.google.com/uc?export=download&id=' + logo_split

Expand Down Expand Up @@ -4923,7 +4931,7 @@ def downloadlogosign(filePathAddProject,projectName_for_folder_path):


Authsign2 = dictDetailsEnv['Authorised Signature Image - 2']
logo_split = str(Authsign1).split('/')[5]
logo_split = str(Authsign2).split('/')[5]


file_url = 'https://drive.google.com/uc?export=download&id=' + logo_split
Expand Down

0 comments on commit 3ae0c41

Please sign in to comment.