Skip to content

Commit

Permalink
[api] and another place where notification events can get too large
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Feb 24, 2015
1 parent 3a45e02 commit a834c5b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/app/models/event/package.rb
Expand Up @@ -51,6 +51,12 @@ class VersionChange < Package
self.raw_type = 'SRCSRV_VERSION_CHANGE'
self.description = 'Package has changed its version'
payload_keys :comment, :requestid, :files, :rev, :newversion, :user, :oldversion

def set_payload(attribs, keys)
attribs['comment'] = attribs['comment'][0..800] unless attribs['comment'].blank?
attribs['files'] = attribs['files'][0..800] unless attribs['files'].blank?
super(attribs, keys)
end
end

class Commit < Package
Expand All @@ -65,7 +71,6 @@ def subject
end

def set_payload(attribs, keys)
# limit the error string
attribs['comment'] = attribs['comment'][0..800] unless attribs['comment'].blank?
attribs['files'] = attribs['files'][0..800] unless attribs['files'].blank?
super(attribs, keys)
Expand Down

0 comments on commit a834c5b

Please sign in to comment.