Skip to content

Commit b5636b5

Browse files
committed
Replace a hardcoded Copyright date with a dynamic one based on now()
1 parent dfca141 commit b5636b5

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

warehouse/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def configure(settings=None):
245245
jglobals = config.get_settings().setdefault("jinja2.globals", {})
246246
jglobals.setdefault("gravatar", "warehouse.utils.gravatar:gravatar")
247247
jglobals.setdefault("esi_include", "warehouse.cache.origin:esi_include")
248+
jglobals.setdefault("now", "warehouse.utils:now")
248249

249250
# We'll store all of our templates in one location, warehouse/templates
250251
# so we'll go ahead and add that to the Jinja2 search path.

warehouse/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
<div {{ l20n("developedByAndCopyright") }}>
110110
<p>Developed and maintained by the Python community, for the Python community.</p>
111-
<p>Copyright © 1990-2015, Python Software Foundation. <a href="#">Legal Statements</a></p>
111+
<p>© {{ now()|format_date('yyyy') }} Python Software Foundation. <a href="#">Legal Statements</a></p>
112112
</div>
113113
</footer>
114114
{% include "warehouse:templates/includes/sponsors.html" %}

warehouse/utils/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
13+
import datetime
14+
15+
16+
def now():
17+
return datetime.datetime.utcnow()

0 commit comments

Comments
 (0)