pleniec / pvpc-core

1 stars 0 forks source link

Unable to get friendship invite id #30

Open Valian opened 9 years ago

Valian commented 9 years ago

I want to decline friendship invite that i sent to someone. Currently to get invite_id i'm doing some ugly things like that:

user=get_or_404(env.api.users.get_single, user_id=user_id, token=me.token),
friendship_invite=first_or_none(get_or_500(env.api.friendship_invites.get, token=me.token, from_user_id=me.id, to_user_id=user_id)),
friendship=first_or_none(get_or_500(env.api.friendships.get, token=me.token, user_id=me.id, to_user_id=user_id))

Anyway, It's still not working. When i want to get id of invite that i sent to someone It throws 'You are not authorized to access this page.'. Possible solution? Maybe you can send me id of relation in 'relation_to_current_user'?

e.g. relation_to_current_user: {'type': 'FRIEND', 'relation_id': 136}. Currently i'm forced to use code like above.