Skip to content

Commit

Permalink
attachments field assingment error
Browse files Browse the repository at this point in the history
  • Loading branch information
ramusus committed Jan 20, 2015
1 parent 05cfb82 commit d3876a4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions vkontakte_wall/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ def parse_remote_id_from_response(self, response):
return None

def parse(self, response):
response.pop('attachment', {})
for attachment in response.pop('attachments', []):
pass
# if attachment['type'] == 'poll':
# это можно делать только после сохранения поста, так что тольо через сигналы
# self.fetch_poll(attachment['poll']['poll_id'])

# TODO: this block broke tests with error
# IntegrityError: new row for relation "vkontakte_wall_post" violates check constraint "vkontakte_wall_post_copy_owner_id_check"
# if response.get('copy_owner_id'):
Expand All @@ -293,7 +286,7 @@ def parse(self, response):

super(Post, self).parse(response)

self.remote_id = '%s%s_%s' % (('-' if self.on_group_wall else ''), self.owner.remote_id, self.remote_id)
self.remote_id = '%s_%s' % (self.owner_remote_id, self.remote_id)

def fetch_statistic(self, *args, **kwargs):
if 'vkontakte_wall_statistic' not in settings.INSTALLED_APPS:
Expand Down

0 comments on commit d3876a4

Please sign in to comment.