@ -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' ] = {}
@ -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,