def retry_facebook_invite(modeladmin, request, queryset):
 invites = list(queryset)
 user_invites = defaultdict(list)
 for invite in invites:
  user_invites[invite.user].append(invite)
 for (user, invites) in user_invites.items():
  profile = get_profile(user)
  graph = profile.get_offline_graph()
  if (not graph):
   error_message = ('couldnt connect to the graph, user access token is %s' % profile.access_token)
   messages.error(request, error_message)
   continue
  logger.info('got graph %s for user %s, retrying %s invites', graph, user, len(invites))
  for invite in invites:
   invite_result = invite.resend(graph)
   message = ('User %s sent attempt to sent with id %s s6 is %s' % (user, invite_result.wallpost_id, (not invite_result.error)))
   if invite_result.error:
    message += (' got error %s' % invite_result.error_message)
   messages.info(request, message)
  profile.update_invite_denormalizations()
  profile.save()

def retry_facebook_invite ( modeladmin , request , queryset ) : invites = list ( queryset ) user_invites = defaultdict ( list ) for invite in invites : user_invites [ invite . user ] . append ( invite ) for ( user , invites ) in user_invites . items ( ) : profile = get_profile ( user ) graph = profile . get_offline_graph ( ) if ( not graph ) : error_message = ( 'couldnt connect to the graph, user access token is %s' % profile . access_token ) messages . error ( request , error_message ) continue logger . info ( 'got graph %s for user %s, retrying %s invites' , graph , user , len ( invites ) ) for invite in invites : invite_result = invite . resend ( graph ) message = ( 'User %s sent attempt to sent with id %s s6 is %s' % ( user , invite_result . wallpost_id , ( not invite_result . error ) ) ) if invite_result . error : message += ( ' got error %s' % invite_result . error_message ) messages . info ( request , message ) profile . update_invite_denormalizations ( ) profile . save ( )
retries sending the invite to the users wall .