From 39134b517ed31703a3415b697e552290e9dd95a7 Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Wed, 10 Feb 2016 23:53:48 +0000 Subject: [PATCH] Cleaned up file_name() --- src/documents/mail.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/documents/mail.py b/src/documents/mail.py index 2fc8e4698..dd58673a5 100644 --- a/src/documents/mail.py +++ b/src/documents/mail.py @@ -2,7 +2,6 @@ import datetime import email import imaplib import os -import random import re import time @@ -93,12 +92,7 @@ class Message(object): @property def file_name(self): - - prefix = str(random.randint(100000, 999999)) - if self.SAFE_SUBJECT_REGEX.match(self.subject): - prefix = self.subject - - return "{}.{}".format(prefix, self.attachment.suffix) + return "{}.{}".format(self.subject, self.attachment.suffix) class Attachment(object):