# HG changeset patch # User Paul Boddie # Date 1443446426 -7200 # Node ID ef1a03f022c4e636b22774a9bff647adba56add1 # Parent f10ca2cdf57bb7c3a6ae1496f2661a4764c0c928 Ensure that the appropriate summary is provided when creating a new event. diff -r f10ca2cdf57b -r ef1a03f022c4 imipweb/calendar.py --- a/imipweb/calendar.py Mon Sep 28 00:28:39 2015 +0200 +++ b/imipweb/calendar.py Mon Sep 28 15:20:26 2015 +0200 @@ -46,14 +46,18 @@ args = self.env.get_args() - if not args.has_key("newevent"): + for key in args.keys(): + if key.startswith("newevent-"): + i = key[len("newevent-"):] + break + else: return # Create a new event using the available information. slots = args.get("slot", []) participants = args.get("participants", []) - summary = args.get("summary", [None])[0] + summary = args.get("summary-%s" % i, [None])[0] if not slots: return @@ -561,6 +565,8 @@ # Produce a heading and time points for each day. + i = 0 + for day, intervals in all_days: groups_for_day = [partitioned.get(day) for partitioned in partitioned_groups] is_empty = True @@ -606,12 +612,14 @@ page.p(class_="newevent-with-periods") page.label("Summary:") - page.input(name="summary", type="text") - page.input(name="newevent", type="submit", value="New event", accesskey="N") + page.input(name="summary-%d" % i, type="text") + page.input(name="newevent-%d" % i, type="submit", value="New event", accesskey="N") page.p.close() page.div.close() + i += 1 + def show_calendar_points(self, intervals, groups, group_types, group_columns): """