From b5636b51e422a059294c6a70f864335d8655764f Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Wed, 6 Jan 2016 07:20:41 -0500 Subject: [PATCH] Replace a hardcoded Copyright date with a dynamic one based on now() --- warehouse/config.py | 1 + warehouse/templates/base.html | 2 +- warehouse/utils/__init__.py | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/warehouse/config.py b/warehouse/config.py index 6c8eb935e872..af666b751e8a 100644 --- a/warehouse/config.py +++ b/warehouse/config.py @@ -245,6 +245,7 @@ def configure(settings=None): jglobals = config.get_settings().setdefault("jinja2.globals", {}) jglobals.setdefault("gravatar", "warehouse.utils.gravatar:gravatar") jglobals.setdefault("esi_include", "warehouse.cache.origin:esi_include") + jglobals.setdefault("now", "warehouse.utils:now") # We'll store all of our templates in one location, warehouse/templates # so we'll go ahead and add that to the Jinja2 search path. diff --git a/warehouse/templates/base.html b/warehouse/templates/base.html index 8d54a31f5f93..3e2de53b1326 100644 --- a/warehouse/templates/base.html +++ b/warehouse/templates/base.html @@ -108,7 +108,7 @@

Developed and maintained by the Python community, for the Python community.

-

Copyright © 1990-2015, Python Software Foundation. Legal Statements

+

© {{ now()|format_date('yyyy') }} Python Software Foundation. Legal Statements

{% include "warehouse:templates/includes/sponsors.html" %} diff --git a/warehouse/utils/__init__.py b/warehouse/utils/__init__.py index 164f68b09175..5aa565d5c21d 100644 --- a/warehouse/utils/__init__.py +++ b/warehouse/utils/__init__.py @@ -9,3 +9,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +import datetime + + +def now(): + return datetime.datetime.utcnow()