Skip to content

Commit

Permalink
Update black
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani committed Sep 14, 2023
1 parent 123bd06 commit 767460b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
args:
Expand All @@ -20,4 +20,4 @@ repos:
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py37-plus]
4 changes: 2 additions & 2 deletions django_jalali/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_prep_lookup(self, lookup_type, value):

if lookup_type in ("exact", "gt", "gte", "lt", "lte"):
prep = self.get_prep_value(value)
if type(prep) == datetime.datetime or type(prep) == datetime.date:
if isinstance(prep, (datetime.datetime, datetime.date)):
return prep
return prep.togregorian()

Expand Down Expand Up @@ -435,7 +435,7 @@ def get_prep_lookup(self, lookup_type, value):

if lookup_type in ("exact", "gt", "gte", "lt", "lte"):
prep = self.get_prep_value(value)
if type(prep) == datetime.datetime or type(prep) == datetime.date:
if isinstance(prep, (datetime.datetime, datetime.date)):
return prep
return prep.togregorian()

Expand Down

0 comments on commit 767460b

Please sign in to comment.