Skip to content
Snippets Groups Projects
Commit c32127be authored by Timur's avatar Timur Committed by GitHub
Browse files

исправил `staticmethod` на обычный метод

parent 94c86052
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,10 +38,10 @@ class Slack(object):
self.post = Post(post, attachments=True)
 
def create_attachments(self):
data_to_send = Post.post_data_prepare(self.post)
data_to_send = self.post.json_prepare()
try:
if self.repost:
data_repost_to_send = Post.post_data_prepare(self.repost)
data_repost_to_send = self.repost.json_prepare()
return json.dumps([data_to_send, data_repost_to_send])
except AttributeError:
data_to_send['mrkdwn_in'] = ['text']
Loading
Loading
@@ -88,18 +88,17 @@ class Post(object):
return image_url, thumb_url
else:
return None, None
@staticmethod
def post_data_prepare(post):
def json_prepare(self):
return {
'fallback': '',
'color': post.color,
'text': post.text,
'ts': post.ts,
'footer': post.footer,
'footer_icon': post.footer_icon,
'image_url': post.image_url,
'thumb_url': post.thumb_url,
'color': self.color,
'text': self.text,
'ts': self.ts,
'footer': self.footer,
'footer_icon': self.footer_icon,
'image_url': self.image_url,
'thumb_url': self.thumb_url,
}
 
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment