fixed bug in tickets2emails, thanks Niphlod

This commit is contained in:
mdipierro
2012-09-01 22:33:46 -05:00
parent 0f94ac864b
commit 9a89a9beac
3 changed files with 5 additions and 7 deletions
+3 -5
View File
@@ -26,10 +26,8 @@ administrator_email = 'you@localhost'
while 1:
for file in os.listdir(path):
filename = os.path.join(path, file)
if not ALLOW_DUPLICATES:
fileobj = open(filename, 'r')
fileobj = open(file, 'r')
try:
file_data = fileobj.read()
finally:
@@ -42,10 +40,10 @@ while 1:
hashes[key] = 1
error = RestrictedError()
error.load(request, request.application, filename)
error.load(request, request.application, file)
mail.send(to=administrator_email, subject='new web2py ticket', message=error.traceback)
os.unlink(filename)
os.unlink(os.path.join(path, file))
time.sleep(SLEEP_MINUTES * 60)