shorten messages

master
Marek Isalski 3 years ago
parent 6af00b14e0
commit 029c28fd8b

@ -88,8 +88,11 @@ def mattermost_incident_command( command, args, channel_id, raw_incident_number,
ev.set_year( datetime.datetime.utcnow().strftime( "%Y" ) ) ev.set_year( datetime.datetime.utcnow().strftime( "%Y" ) )
written = ev.write() written = ev.write()
short_written = written
if len( short_written ) > 512:
short_written = short_written[ :509 ] + "..."
app.mm.posts.create_post( options = { 'channel_id': private_channel_id, app.mm.posts.create_post( options = { 'channel_id': private_channel_id,
'message': "#### Written `%s`:\n\n```\n%s```" % ( ev.path_short(), written ), 'message': "#### Written `%s`:\n\n```\n%s```" % ( ev.path_short(), short_written ),
} ) } )
cmdline = app.config[ "MERCURIAL_BIN" ] + " add " + ev.path_short() cmdline = app.config[ "MERCURIAL_BIN" ] + " add " + ev.path_short()

Loading…
Cancel
Save