Merge "Don't add duplicate entries to metadata.txt"
This commit is contained in:
commit
c425c56765
|
@ -30,8 +30,10 @@ def saveform(form, storagedir):
|
|||
fp.close()
|
||||
shutil.move(fp.name, filename)
|
||||
else:
|
||||
fp = open(os.path.join(storagedir, "metadata.txt"), "a")
|
||||
fp.write("%s=%s\n" % (entry.name, entry.value))
|
||||
line = "%s=%s\n" % (entry.name, entry.value)
|
||||
fp = open(os.path.join(storagedir, "metadata.txt"), "a+")
|
||||
if line not in fp.read():
|
||||
fp.write(line)
|
||||
fp.close()
|
||||
|
||||
def run():
|
||||
|
|
Loading…
Reference in New Issue