[gsoc-admin] EventConfig: Take last matching date



commit c4277e929b90ad91a1a36907b9f93f35dba8856f
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Mon Oct 5 20:34:30 2015 +0200

    EventConfig: Take last matching date
    
    The ICS might well contain dates from past years.

 maillib/config.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/maillib/config.py b/maillib/config.py
index fb17417..9805dbb 100644
--- a/maillib/config.py
+++ b/maillib/config.py
@@ -78,10 +78,10 @@ class EventConfig:
                     (event.name is not None and
                      compiled.match(event.name))):
                 self.dates[section.name] = event
-                return
 
-        raise AssertionError("There are no events matching the regular "
-                             "expression '{}'.".format(regex))
+        assert section.name in self.dates, ("There are no events matching the "
+                                            "regular xpression '{}'."
+                                            .format(regex))
 
     def append_mail_from_section(self, section):
         text = get_main_data_from_section(section)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]