mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 07:46:18 +00:00
Fixed for #843
This commit is contained in:
@@ -1463,7 +1463,6 @@ def API_Email_PreviewBody():
|
|||||||
try:
|
try:
|
||||||
template = Template(body)
|
template = Template(body)
|
||||||
download = p.downloadPeer()
|
download = p.downloadPeer()
|
||||||
# body = template.render(peer=p.toJson(), configurationFile=download)
|
|
||||||
return ResponseObject(data={
|
return ResponseObject(data={
|
||||||
"Body": Template(body).render(peer=p.toJson(), configurationFile=download),
|
"Body": Template(body).render(peer=p.toJson(), configurationFile=download),
|
||||||
"Subject": Template(subject).render(peer=p.toJson(), configurationFile=download)
|
"Subject": Template(subject).render(peer=p.toJson(), configurationFile=download)
|
||||||
|
@@ -192,6 +192,10 @@ class Peer:
|
|||||||
for (key, val) in combine[s]:
|
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)):
|
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"] += f"{key} = {val}\n"
|
||||||
|
|
||||||
|
final["file"] = jinja2.Template(final["file"]).render(configuration=self.configuration)
|
||||||
|
|
||||||
|
|
||||||
if self.configuration.Protocol == "awg":
|
if self.configuration.Protocol == "awg":
|
||||||
final["amneziaVPN"] = json.dumps({
|
final["amneziaVPN"] = json.dumps({
|
||||||
"containers": [{
|
"containers": [{
|
||||||
|
Reference in New Issue
Block a user