refactor try except block (#1084)
This commit is contained in:
parent
25dfc6bcae
commit
b92fedbcc9
1 changed files with 28 additions and 27 deletions
|
|
@ -78,7 +78,7 @@ async def api_lnurl_callback(
|
||||||
return {"status": "ERROR", "reason": f"Wait {link.open_time - now} seconds."}
|
return {"status": "ERROR", "reason": f"Wait {link.open_time - now} seconds."}
|
||||||
|
|
||||||
usescsv = ""
|
usescsv = ""
|
||||||
try:
|
|
||||||
for x in range(1, link.uses - link.used):
|
for x in range(1, link.uses - link.used):
|
||||||
usecv = link.usescsv.split(",")
|
usecv = link.usescsv.split(",")
|
||||||
usescsv += "," + str(usecv[x])
|
usescsv += "," + str(usecv[x])
|
||||||
|
|
@ -106,6 +106,7 @@ async def api_lnurl_callback(
|
||||||
"usescsv": usecsvback,
|
"usescsv": usecsvback,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
changes = {
|
changes = {
|
||||||
"open_time": link.wait_time + now,
|
"open_time": link.wait_time + now,
|
||||||
"used": link.used + 1,
|
"used": link.used + 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue