Skip to content

Commit add87f8

Browse files
authored
Merge pull request #6 from lnbits/fix_fixups
fix optional fields in model
2 parents 4a679b5 + ec91f78 commit add87f8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

models.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
55

66
from fastapi.param_functions import Query
7+
from fastapi.requests import Request
78
from lnurl.types import LnurlPayMetadata
89
from pydantic import BaseModel
9-
from fastapi.requests import Request
1010

1111
from lnbits.lnurl import encode as lnurl_encode
1212

@@ -37,27 +37,27 @@ class CreateCopilotData(BaseModel):
3737

3838
class Copilot(BaseModel):
3939
id: str
40-
user: str
40+
user: Optional[str]
4141
title: str
4242
lnurl_toggle: int
43-
wallet: str
44-
animation1: str
45-
animation2: str
46-
animation3: str
47-
animation1threshold: str
48-
animation2threshold: str
49-
animation3threshold: str
50-
animation1webhook: str
51-
animation2webhook: str
52-
animation3webhook: str
53-
lnurl_title: str
43+
wallet: Optional[str]
44+
animation1: Optional[str]
45+
animation2: Optional[str]
46+
animation3: Optional[str]
47+
animation1threshold: int
48+
animation2threshold: int
49+
animation3threshold: int
50+
animation1webhook: Optional[str]
51+
animation2webhook: Optional[str]
52+
animation3webhook: Optional[str]
53+
lnurl_title: Optional[str]
5454
show_message: int
5555
show_ack: int
56-
show_price: str
56+
show_price: Optional[str]
5757
amount_made: int
5858
timestamp: int
5959
fullscreen_cam: int
60-
iframe_url: str
60+
iframe_url: Optional[str]
6161

6262
def lnurl(self, req: Request) -> str:
6363
url = req.url_for("copilot.lnurl_response", cp_id=self.id)

0 commit comments

Comments
 (0)