mirror of https://gitlab.com/bashrc2/epicyon
Check admin status when saving peertube sites list
parent
3d16d93d86
commit
f16ae830b0
16
daemon.py
16
daemon.py
|
@ -4566,13 +4566,19 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
os.remove(allowedInstancesFilename)
|
os.remove(allowedInstancesFilename)
|
||||||
|
|
||||||
# save peertube instances list
|
# save peertube instances list
|
||||||
peertubeInstancesFilename = \
|
peertubeInstancesFile = \
|
||||||
baseDir + '/accounts/peertube.txt'
|
baseDir + '/accounts/peertube.txt'
|
||||||
if fields.get('ptInstances'):
|
if fields.get('ptInstances'):
|
||||||
|
adminNickname = \
|
||||||
|
getConfigParam(baseDir, 'admin')
|
||||||
|
if adminNickname and \
|
||||||
|
path.startswith('/users/' +
|
||||||
|
adminNickname + '/'):
|
||||||
self.server.peertubeInstances.clear()
|
self.server.peertubeInstances.clear()
|
||||||
with open(peertubeInstancesFilename, 'w+') as aFile:
|
with open(peertubeInstancesFile, 'w+') as aFile:
|
||||||
aFile.write(fields['ptInstances'])
|
aFile.write(fields['ptInstances'])
|
||||||
ptInstancesList = fields['ptInstances'].split('\n')
|
ptInstancesList = \
|
||||||
|
fields['ptInstances'].split('\n')
|
||||||
if ptInstancesList:
|
if ptInstancesList:
|
||||||
for url in ptInstancesList:
|
for url in ptInstancesList:
|
||||||
url = url.strip()
|
url = url.strip()
|
||||||
|
@ -4582,8 +4588,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
continue
|
continue
|
||||||
self.server.peertubeInstances.append(url)
|
self.server.peertubeInstances.append(url)
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(peertubeInstancesFilename):
|
if os.path.isfile(peertubeInstancesFile):
|
||||||
os.remove(peertubeInstancesFilename)
|
os.remove(peertubeInstancesFile)
|
||||||
self.server.peertubeInstances.clear()
|
self.server.peertubeInstances.clear()
|
||||||
|
|
||||||
# save git project names list
|
# save git project names list
|
||||||
|
|
Loading…
Reference in New Issue