Merge pull request #900 from WGDashboard/v4.3.1
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker Build and Push / docker_build (push) Has been cancelled
Docker Build and Push / docker_scan (push) Has been cancelled

Fixed for #843
This commit is contained in:
Donald Zou
2025-09-17 16:36:31 +08:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -1463,7 +1463,6 @@ def API_Email_PreviewBody():
try:
template = Template(body)
download = p.downloadPeer()
# body = template.render(peer=p.toJson(), configurationFile=download)
return ResponseObject(data={
"Body": Template(body).render(peer=p.toJson(), configurationFile=download),
"Subject": Template(subject).render(peer=p.toJson(), configurationFile=download)

View File

@@ -192,6 +192,10 @@ class Peer:
for (key, val) in combine[s]:
if val is not None and ((type(val) is str and len(val) > 0) or (type(val) is int and val > 0)):
final["file"] += f"{key} = {val}\n"
final["file"] = jinja2.Template(final["file"]).render(configuration=self.configuration)
if self.configuration.Protocol == "awg":
final["amneziaVPN"] = json.dumps({
"containers": [{