mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Cleaned up file_name()
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user