Skip to content

Commit

Permalink
further url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
shivareddyiirs committed Oct 23, 2019
1 parent a6c0092 commit fc17136
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions QRealTime_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def importData(self,layer,selectedForm,importData):
furl=url+'//formXml?formId='+selectedForm
else:
self.iface.messageBar().pushWarning(self.tr(self.tag),self.tr("Enter url in settings"))
return {},None
return
try:
response= requests.request('GET',furl,proxies=getProxiesConf(),auth=self.getAuth(),verify=False)
except:
Expand Down Expand Up @@ -527,13 +527,22 @@ def transformToLayerSRS(self, pPoint):


def getTable(self,XFormKey,importData,topElement,version= 'null'):
url=self.getValue('url')+'/view/submissionList?formId='+XFormKey
method='GET'
turl=self.getValue('url')
table=[]
if turl:
url=turl+'/view/submissionList?formId='+XFormKey
else:
self.iface.messageBar().pushWarning(self.tr(self.tag),self.tr("Enter url in settings"))
return None,table
method='GET'
lastID=""
if not importData:
lastID=self.getValue('lastID')
response = requests.request(method,url,proxies=getProxiesConf(),auth=self.getAuth(),verify=False)
try:
response = requests.request(method,url,proxies=getProxiesConf(),auth=self.getAuth(),verify=False)
except:
self.iface.messageBar().pushWarning(self.tr(self.tag),self.tr("Not able to connect to server"))
return response, table
if not response.status_code == 200:
return response, table
try:
Expand Down

0 comments on commit fc17136

Please sign in to comment.