forked from indymedia/epicyon
Prepend to followers file
parent
cd98704ce5
commit
667d0262ea
|
@ -128,9 +128,13 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
||||||
followersFilename=accountsDir+'/followers.txt'
|
followersFilename=accountsDir+'/followers.txt'
|
||||||
if os.path.isfile(followersFilename):
|
if os.path.isfile(followersFilename):
|
||||||
if approveHandle not in open(followersFilename).read():
|
if approveHandle not in open(followersFilename).read():
|
||||||
followersFile=open(followersFilename, "a+")
|
try:
|
||||||
followersFile.write(approveHandle+'\n')
|
with open(followersFilename, 'r+') as followersFile:
|
||||||
followersFile.close()
|
content = followersFile.read()
|
||||||
|
followersFile.seek(0, 0)
|
||||||
|
followersFile.write(approveHandle+'\n'+content)
|
||||||
|
except Exception as e:
|
||||||
|
print('WARN: Failed to write entry to followers file '+str(e))
|
||||||
else:
|
else:
|
||||||
followersFile=open(followersFilename, "w+")
|
followersFile=open(followersFilename, "w+")
|
||||||
followersFile.write(approveHandle+'\n')
|
followersFile.write(approveHandle+'\n')
|
||||||
|
|
Loading…
Reference in New Issue