Merge pull request #187435 from mweinelt/django_3_zoneinfo
This commit is contained in:
commit
b76729a06d
2 changed files with 20 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
, asgiref
|
||||
, pytz
|
||||
, sqlparse
|
||||
, tzdata
|
||||
, pythonOlder
|
||||
, withGdal ? false
|
||||
}:
|
||||
|
@ -24,7 +25,12 @@ buildPythonPackage rec {
|
|||
hash = "sha256-9xk0sagi8UqGyayWNAU2iSec0ErmnLat5KWUcbiGWCs=";
|
||||
};
|
||||
|
||||
patches = lib.optional withGdal
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./django_3_set_zoneinfo_dir.patch;
|
||||
zoneinfo = tzdata + "/share/zoneinfo";
|
||||
})
|
||||
] ++ lib.optional withGdal
|
||||
(substituteAll {
|
||||
src = ./django_3_set_geos_gdal_lib.patch;
|
||||
inherit geos39;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
|
||||
index 28302440c7..278cfa5e62 100644
|
||||
--- a/django/conf/__init__.py
|
||||
+++ b/django/conf/__init__.py
|
||||
@@ -200,7 +200,7 @@ class Settings:
|
||||
if hasattr(time, 'tzset') and self.TIME_ZONE:
|
||||
# When we can, attempt to validate the timezone. If we can't find
|
||||
# this file, no check happens and it's harmless.
|
||||
- zoneinfo_root = Path('/usr/share/zoneinfo')
|
||||
+ zoneinfo_root = Path('@zoneinfo@')
|
||||
zone_info_file = zoneinfo_root.joinpath(*self.TIME_ZONE.split('/'))
|
||||
if zoneinfo_root.exists() and not zone_info_file.exists():
|
||||
raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
|
Loading…
Reference in a new issue