mirror of https://git.48k.eu/ogcp
views: Warn user when no logs available
Warn user if trying to access the logs of a client that don't yet exist. This is prefered to showing the backtrace to the user.master
parent
58852f68aa
commit
58b5b2eca0
|
@ -2100,6 +2100,9 @@ def action_legacy_log():
|
|||
return redirect(url_for('commands'))
|
||||
ip = ips.pop()
|
||||
log_file = Path("/opt/opengnsys/log/clients/" + str(ip) + ".log")
|
||||
if not os.access(log_file, os.R_OK):
|
||||
flash(_('No log available for this client yet'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
log = log_file.read_text()
|
||||
if log:
|
||||
scopes, clients = get_scopes(set(ips))
|
||||
|
|
Loading…
Reference in New Issue