mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-05-13 23:06:20 +00:00
Merge pull request #1273 from sgtdeagle/name-attachment-file-after-configname
change email attachmentname to peerName if not empty
This commit is contained in:
@@ -1558,7 +1558,8 @@ def API_Email_Send():
|
|||||||
subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download)
|
subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download)
|
||||||
if data.get('IncludeAttachment', False):
|
if data.get('IncludeAttachment', False):
|
||||||
u = str(uuid4())
|
u = str(uuid4())
|
||||||
attachmentName = f'{u}.conf'
|
peerName = p.toJson().get('name', '').strip()
|
||||||
|
attachmentName = f'{peerName if peerName else u}.conf'
|
||||||
with open(os.path.join('./attachments', attachmentName,), 'w+') as f:
|
with open(os.path.join('./attachments', attachmentName,), 'w+') as f:
|
||||||
f.write(download['file'])
|
f.write(download['file'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user