mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
handeling user with not enougth permissions
This commit is contained in:
parent
b48651c31e
commit
c707a57634
@ -74,6 +74,7 @@ def parse_graph_conf(cGraph):
|
|||||||
|
|
||||||
def get_graph_by_moduleid (baseUrl,pUser, pPass, apiPass, moduleId, graphInterval, sep="url_encode_separator_%7C") :
|
def get_graph_by_moduleid (baseUrl,pUser, pPass, apiPass, moduleId, graphInterval, sep="url_encode_separator_%7C") :
|
||||||
"""Call Pandorafms api to get graph"""
|
"""Call Pandorafms api to get graph"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}&apipass={apiPass}&api=1&user={pUser}&pass={pPass}"
|
url = f"{baseUrl}?op=get&op2=module_graph&id={moduleId}&other={graphInterval}%7C1&other_mode={sep}&apipass={apiPass}&api=1&user={pUser}&pass={pPass}"
|
||||||
graph = requests.get(url)
|
graph = requests.get(url)
|
||||||
@ -86,6 +87,9 @@ def get_graph_by_moduleid (baseUrl,pUser, pPass, apiPass, moduleId, graphInterva
|
|||||||
if graph.text == "Id does not exist in database.":
|
if graph.text == "Id does not exist in database.":
|
||||||
print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation")
|
print (f"Error requested Pandora api url, status code: {graph.text}. Skiping graph generation")
|
||||||
return None
|
return None
|
||||||
|
if graph.text == "The user has not enough permissions for perform this action.":
|
||||||
|
print (f"Error requested Pandora api url, status code: {graph.text} Skiping graph generation")
|
||||||
|
return None
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print("Error requested api url. Skiping graph generation")
|
print("Error requested api url. Skiping graph generation")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user