From c11ac9acfbdc0dbcd3105cf7cfc7be8a017e0615 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 16 Apr 2026 13:28:36 -0500 Subject: Provide defaults for Year and Month. Year is a required field, but we provide the month too. --- uploader/publications/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'uploader/publications') diff --git a/uploader/publications/views.py b/uploader/publications/views.py index d9eb294..89e9f5d 100644 --- a/uploader/publications/views.py +++ b/uploader/publications/views.py @@ -1,5 +1,6 @@ """Endpoints for publications""" import json +import datetime from gn_libs.mysqldb import database_connection from flask import ( @@ -89,9 +90,12 @@ def create_publication(): } if request.method == "GET": + now = datetime.datetime.now() return render_template( "publications/create-publication.html", - get_args=_get_args) + get_args=_get_args, + current_year=now.year, + current_month=now.strftime("%B")) form = request.form authors = form.get("publication-authors").encode("utf8") if authors is None or authors == "": -- cgit 1.4.1