diff --git a/event.py b/event.py index d1813ee..dce348a 100644 --- a/event.py +++ b/event.py @@ -90,6 +90,10 @@ class Event( Index ): def set_slug( self, slug ): self.fields[ '$slug' ] = slug + def set_year( self, year ): + if not self.fields.get( 'year' ): + self.fields[ 'year' ] = year + def set_published( self, published ): if not self.fields.get( '$date' ): self.fields[ '$date' ] = {} diff --git a/fih.py b/fih.py index 4b685bd..eecdfe3 100644 --- a/fih.py +++ b/fih.py @@ -85,6 +85,7 @@ def mattermost_incident_command( command, args, channel_id, raw_incident_number, ev.set_title( channel[ 'purpose' ] ) ev.set_slug( raw_incident_number ) ev.set_published( datetime.datetime.utcnow().strftime( "%Y-%m-%d %H:%M" ) ) + ev.set_year( datetime.datetime.utcnow().strftime( "%Y" ) ) written = ev.write() app.mm.posts.create_post( options = { 'channel_id': private_channel_id,