Commit Graph

68 Commits

Author SHA1 Message Date
dni ⚡
daa4b92331
fix: db helpers to be used with timestamps (#2627)
* fix: db helpers to be used with timestamps

those helpers are used in boltz extension and they did not take dates
into consideration yet

* vlad picks
* refactor get_placeholder

---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
2024-08-06 12:43:44 +02:00
dni ⚡
b145bff566 chore: adhere to ruff's UP
basically use `list` and `type` instead of `List` and `Type`

this is save to use for python3.9 and has been deprecated. also has some
performance drawbacks.
read more here: https://docs.astral.sh/ruff/rules/non-pep585-annotation/
2024-04-15 13:38:04 +02:00
dni ⚡
6d5ad9e229
chore: adhere to ruff's "N" rules (#2377)
* chore: adhere to ruff's "N" rules

WARN: reinstall failing extensions!

bunch of more consistent variable naming. inspired by this issue.
https://github.com/lnbits/lnbits/issues/2308

* fixup! chore: adhere to ruff's "N" rules
* rename to funding_source
* skip jmeter

---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
2024-04-15 09:02:21 +02:00
dni ⚡
c67fcf0e45 chore: adhere to ruff's A
dont use pythjons builts in functions name as variable
2024-04-02 17:11:06 +02:00
dni ⚡
17839f6a25
feat: add database debug env var (#2333)
* feat: add database debug env var
makes it visible what db actions happen
2024-03-21 09:59:17 +01:00
dni ⚡
7ce4eddb0e
feat: add group_by to fetch_page (#2140)
---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
2024-03-12 13:55:38 +01:00
dni ⚡
815c3e61e4
feat: add created_at and updated_at to wallets and accounts (#2177)
* feat: add `created_at` and `updated_at` to wallets and accounts

the title says it all :)

* fixup!

* nitpicks :)

* fixup!

* sqlite fix

* sqlite compat

* fixup!

* mypy

* revert db py

* motorinas suggestions

* int(time()) proper default values in migration

* uncomment migration

* use now = int(time()) idiom to make code more readable

also this fixes the issue where time() is called multiple times
providing different return values for multiple invocations

---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
2023-12-21 12:37:56 +00:00
jackstar12
1b2db34e08
[FEAT] create data folder if it doesnt exist (#1930) 2023-09-12 11:56:21 +02:00
dni ⚡
4e6f229db2
[CHORE] string formatting default length 88 (#1887)
* [CHORE] string formatting default length 88

uses blacks default off 88 and enabled autostringformatting

* formatting

* nitpicks jackstar

fix
2023-08-24 10:26:09 +01:00
dni ⚡
fe88320f08
[CHORE] update mypy and new issues (#1892)
* [CHORE] update mypy and new issues

lnbits/cache.py:21: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/extension_manager.py:210: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/db.py:110: error: Only instance methods can be decorated with @property  [misc]
lnbits/tasks.py:152: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/tasks.py:171: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/core/services.py:520: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/app.py:520: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/app.py:525: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lnbits/app.py:532: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

* fix db.py
* fix mypy notes, type were not needed
2023-08-23 21:24:54 +02:00
dni ⚡
26a0633d49
[CHORE] fix pyright warning in db.py (#1868)
```warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)```
2023-08-16 12:41:49 +02:00
dni ⚡
f0a66e41fb
[CHORE] flake8 issues E402, E721 and F821 (#1874)
* F821: undefine name
disabled and logged webhook_listener for opennode and lnpay because they are obviously not working
* E402: module level import not at top of file
* E721 fixes, only popped up for python3.9 not 3.10
2023-08-16 12:22:14 +02:00
jackstar12
1ab81f6d7e
Bug: invalid type converter (#1842)
* temporary test case

* remove buggy converter
2023-07-31 10:21:45 +02:00
jackstar12
67d3a4f359
remove nested filters (#1843)
* remove nested filters

* remove from openapi schema aswell
2023-07-31 10:21:30 +02:00
Vlad Stan
8c0e7725de
Add option to drop extension db at un-install time or later (#1746)
* chore: remove un-used file
* feat: allow extension DB clean-up
* feat: i18n and bundle update
* chore: code format
* fix: button color
* chore: delete temp file
* chore: fix merge conflicts
* chore: add extra log
* chore: bump CACHE_VERSION to `37`
2023-06-15 16:22:18 +02:00
jackstar12
252fd6c313
feat: specify sort fields (#1716)
* feat: specify sort fields

* doc string
2023-05-22 12:11:05 +01:00
jackstar12
c0f66989cb
Serverside Pagination for payments (#1613)
* initial backend support

* implement payments pagination on frontend

* implement search for payments api

* fix pyright issues

* sqlite support for searching

* backwards compatability

* formatting, small fixes

* small optimization

* fix sorting issue, add error handling

* GET payments test

* filter by dates, use List instead of list

* fix sqlite

* update bundle

* test old payments endpoint aswell

* refactor for easier review

* optimise test

* revert unnecessary change

---------

Co-authored-by: dni  <office@dnilabs.com>
2023-05-09 09:18:53 +01:00
dni ⚡
0af22a6256
E471 2023-04-17 08:21:45 +02:00
callebtc
234b508368
shorten and ignore cln.py 2023-04-04 07:35:19 +02:00
Pavol Rusnak
02306148df
fix pyright lnbits
Co-authored-by: dni  <office@dnilabs.com>
2023-04-04 07:34:17 +02:00
dni ⚡
8ce84ce592
FEAT: Filters for GET requests, add it to GET /payments (#1557)
* feat filters, add them to GET payments

* add limit and offset to filters (#1563)

* add limit and offset to filters
* move filters example to parse_filters doc string

* black

* add openapi docs

* remove example commentC

* improve typing and make nested filter possible in openapi

* typo in fn name

* readd Type

---------

Co-authored-by: jackstar12 <62219658+jackstar12@users.noreply.github.com>
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2023-04-03 14:55:49 +02:00
Pavol Rusnak
eba7319808
fix flake8 E713 (test-for-membership) 2023-01-30 11:46:44 +00:00
Vlad Stan
c370bd18c6 refactor: remove redundant # type: ignore 2023-01-10 09:45:12 +02:00
Vlad Stan
6cab77ece4
Merge branch 'main' into FinalAdminUI 2022-12-12 10:49:31 +02:00
callebtc
3bb11dc487 separate migrations 2022-12-06 16:21:19 +01:00
callebtc
4e69924c9c fix datetime conversion 2022-12-02 17:38:36 +01:00
dni ⚡
803c9349d4 merge main 2022-12-01 12:37:08 +01:00
callebtc
872d5a6702 use isinstance, not type 2022-12-01 12:21:25 +01:00
callebtc
92435e8492 rewrite values in db 2022-12-01 12:21:25 +01:00
callebtc
c901a5c69d strip html 2022-12-01 12:21:25 +01:00
ben
cbd939f35b Revert "Merge remote-tracking branch 'origin/fix/strip_html_db' into feature/satspay-server-custom-css"
This reverts commit f98278faba.
2022-12-01 12:21:25 +01:00
callebtc
824baa4f2a use isinstance, not type 2022-12-01 12:21:25 +01:00
callebtc
2ec150fd13 rewrite values in db 2022-12-01 12:21:25 +01:00
callebtc
6d16ac0f0a strip html 2022-12-01 12:21:25 +01:00
Vlad Stan
d0e42a3c2d fix: do not apply list() to str value 2022-11-30 22:08:23 +02:00
callebtc
aa0fbde541 use isinstance, not type 2022-11-25 15:20:39 +01:00
callebtc
b970f0cb0c rewrite values in db 2022-11-25 15:11:58 +01:00
callebtc
60cc0ca11a strip html 2022-11-25 14:53:03 +01:00
dni ⚡
f9de542361 use new settings and remove unused amdin extension stuff 2022-10-25 09:23:30 +02:00
Vlad Stan
7711387d64
fix: use bigint for amounts in postgres (#1030) 2022-10-07 14:23:57 +02:00
calle
f4e7d62ca3
make format everything (#743) 2022-07-16 14:23:03 +02:00
calle
089313f613
Logging with loguru (#708)
* logging

* requirements

* add loguru dependency

* restore it

* add loguru

* set log level in .env file

* remove service fee print

* set log level

* more logging

* more logging

* more logging

* pyament.checking_id

* fix
2022-07-07 14:30:16 +02:00
Axel Hodler
946ebc350e fail early if LNBITS_DATA_FOLDER missing 2022-03-27 17:03:24 +02:00
Tiago vasconcelos
c34041c49c add hack for milliseconds on postgres 2021-11-15 12:11:42 +00:00
Stefan Stammberger
d9849d43d2
refactor: replace Trio with asyncio/uvloop 2021-08-30 19:55:02 +02:00
fiatjaf
1c0a4e252a explicit postgres type numbers in anti-conversion table. 2021-08-11 22:53:34 -03:00
fiatjaf
e0496fb244 fix postgres type translation bug and add some logs. 2021-08-01 10:30:27 -03:00
fiatjaf
ffadce02b0 support cockroachdb. 2021-07-02 18:32:58 -03:00
fiatjaf
46eab3b35e psycopg2 only imported when postgres. 2021-07-02 17:34:33 -03:00
fiatjaf
2f309c9863 postgres support. 2021-07-02 17:34:31 -03:00