Skip to content

Commit

Permalink
added db layer logging in console (#272)
Browse files Browse the repository at this point in the history
* added db layer logging in console
* fixed typos errors
- updated typos to 1.20.0
  • Loading branch information
introkun authored Apr 2, 2024
1 parent f4e8851 commit 4f4b706
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[files]
extend-exclude = ["**/bundle.js", "**/bundle.js.map"]
extend-exclude = ["**/bundle.js", "**/bundle.js.map"]

[default]
extend-ignore-identifiers-re = [
"zUfuhFKKZCbHTY6aRR46gxiqszMk5tcHjsVFxnUo8VMus4kHGVdIYVbOYYNlKmHV",
]
5 changes: 2 additions & 3 deletions backend/views/core/invoices/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ def invoice_get_existing_data(invoice_obj):
"from_country": invoice_obj.self_country,
"from_date_issued": invoice_obj.date_issued,
"from_date_due": invoice_obj.date_due,
"invoice_object": invoice_obj,
"og_issue_date": invoice_obj.date_issued,
"og_due_date": invoice_obj.date_due,
"issue_date": invoice_obj.date_issued,
"due_date": invoice_obj.date_due,
"invoice_object": invoice_obj,
"currency_symbol": invoice_obj.get_currency_symbol(),
"rows": invoice_obj.items.all(),
Expand Down
4 changes: 2 additions & 2 deletions frontend/templates/pages/invoices/edit/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3 class="text-sm text-natural font-semibold hidden lg:block text-end me-6">To<
id="dateIssued"
name="date_issued"
placeholder=""
value="{{ og_issue_date | date:"Y-m-d" }}"
value="{{ issue_date | date:"Y-m-d" }}"
type="date"
class="peer input input-bordered input-block">
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden ">
Expand All @@ -52,7 +52,7 @@ <h3 class="text-sm text-natural font-semibold hidden lg:block text-end me-6">To<
placeholder=""
type="date"
class="peer input-bordered input input-block"
value="{{ og_due_date | date:"Y-m-d" }}">
value="{{ due_date | date:"Y-m-d" }}">
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden ">
<span class="label-text-alt text-error">Please enter a valid date.</span>
</label>
Expand Down
46 changes: 24 additions & 22 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ django = "^5.0.2"
django-mathfilters = "^1.0.0"
sample-helper-aws-appconfig = "^2.1.0"
redis = { extras = ["hiredis"], version = "^5.0.1" }
boto3-stubs = { extras = ["sesv2", "events", "scheduler", "iam", "stepfunctions"], version = "^1.34.54" }
boto3-stubs = { extras = [
"sesv2",
"events",
"scheduler",
"iam",
"stepfunctions",
], version = "^1.34.54" }
djangorestframework = "^3.14.0"
django-tz-detect = "^0.4.0"
typos = "^1.19.0"
typos = "^1.20.0"

[tool.poetry.group.django.dependencies]
Django = "^5.0.2"
Expand Down Expand Up @@ -70,4 +76,4 @@ line-length = 140

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
6 changes: 6 additions & 0 deletions settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ class CustomPublicMediaStorage(S3Storage):
},
},
"handlers": {"console": {"class": "logging.StreamHandler", "formatter": "simple"}},
"loggers": {
"django.db.backends": {
"handlers": ["console"],
"level": get_var("DJANGO_LOG_LEVEL", default="INFO"),
},
},
"root": {
"handlers": ["console"],
"level": get_var("DJANGO_LOG_LEVEL", default="INFO"),
Expand Down
File renamed without changes.

0 comments on commit 4f4b706

Please sign in to comment.