Hardcode email logo to DM-Logo_compress.png and remove configurable logo path
This commit is contained in:
parent
60d2ad8325
commit
72fa09a6e1
2 changed files with 5 additions and 12 deletions
12
app.py
12
app.py
|
|
@ -299,13 +299,11 @@ def send_email(to, subject, body, attachments=None, inline_images=None):
|
|||
server.send_message(msg)
|
||||
|
||||
def build_signature_images():
|
||||
"""Return inline image tuple list for the Dionysis Media logo if present."""
|
||||
cfg = load_booth_settings()
|
||||
logo_path = cfg.get('logo_path') or '/mnt/Storage/DM-Logo_compress.png'
|
||||
logo_file = Path(logo_path)
|
||||
if not logo_file.exists():
|
||||
"""Return inline image tuple list for the Dionysis Media logo."""
|
||||
logo_path = Path('/mnt/Storage/DM-Logo_compress.png')
|
||||
if not logo_path.exists():
|
||||
return []
|
||||
return [(str(logo_file), 'dm-logo')]
|
||||
return [(str(logo_path), 'dm-logo')]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
@ -690,7 +688,6 @@ def admin_settings():
|
|||
'smtp_user': runtime_settings.get('smtp_user', current_app.config['SMTP_USER']),
|
||||
'smtp_from': runtime_settings.get('smtp_from', current_app.config['SMTP_FROM']),
|
||||
'smtp_pass_set': bool(runtime_settings.get('smtp_pass', '')),
|
||||
'logo_path': runtime_settings.get('logo_path', '/mnt/Storage/DM-Logo_compress.png'),
|
||||
}
|
||||
|
||||
# Compute upload folder stats.
|
||||
|
|
@ -801,7 +798,6 @@ def admin_settings():
|
|||
cfg['smtp_port'] = request.form.get('smtp_port', '').strip() or None
|
||||
cfg['smtp_user'] = request.form.get('smtp_user', '').strip() or None
|
||||
cfg['smtp_from'] = request.form.get('smtp_from', '').strip() or None
|
||||
cfg['logo_path'] = request.form.get('logo_path', '').strip() or None
|
||||
new_pass = request.form.get('smtp_pass', '').strip()
|
||||
# Only overwrite the stored password if a new value was provided.
|
||||
if new_pass:
|
||||
|
|
|
|||
|
|
@ -263,10 +263,7 @@
|
|||
<input type="password" id="smtp_pass" name="smtp_pass" placeholder="{% if email_form.smtp_pass_set %}Stored encrypted — type to replace{% else %}Enter password{% endif %}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Logo Path</td>
|
||||
<td><input type="text" id="logo_path" name="logo_path" value="{{ email_form.logo_path }}" placeholder="e.g. /mnt/Storage/DM-Logo_compress.png"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<button type="submit">Save Email Settings</button>
|
||||
</form>
|
||||
|
|
|
|||
Reference in a new issue