beancount-gocardless 0.1.4__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: beancount-gocardless
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "beancount-gocardless"
3
- version = "0.1.4"
3
+ version = "0.1.6"
4
4
  description = ""
5
5
  authors = []
6
6
  readme = "README.md"
@@ -4,6 +4,12 @@ import requests
4
4
  from typing import TypedDict, Optional
5
5
 
6
6
 
7
+ def remove_vary_header(response):
8
+ if "Vary" in response.headers:
9
+ del response.headers["Vary"] # Fuck it, it’s gone
10
+ return response
11
+
12
+
7
13
  class CacheOptions(TypedDict, total=False):
8
14
  """
9
15
  Options for configuring requests-cache.
@@ -55,7 +61,9 @@ class BaseService:
55
61
  "cache_name": "nordigen",
56
62
  "backend": "sqlite",
57
63
  "expire_after": 0,
58
- "old_data_on_error": False,
64
+ "old_data_on_error": True,
65
+ "match_headers": False,
66
+ "response_hook": remove_vary_header,
59
67
  }
60
68
 
61
69
  def __init__(
@@ -148,12 +148,7 @@ class NordigenImporter(beangulp.Importer):
148
148
  f"{instructedAmount['currency']} {instructedAmount['amount']}"
149
149
  )
150
150
 
151
- # Booking date if different from value date
152
- if (
153
- transaction.get("bookingDate")
154
- and transaction.get("valueDate")
155
- and transaction["bookingDate"] != transaction["valueDate"]
156
- ):
151
+ if transaction.get("bookingDate"):
157
152
  metakv["bookingDate"] = transaction["bookingDate"]
158
153
 
159
154
  if filing_account: