labpack/events/meetup.py
def update_member_profile(self, brief_details, profile_details):

        ''' a method to update user profile details on meetup

        :param brief_details: dictionary with member brief details with updated values
        :param profile_details: dictionary with member profile details with updated values
        :return: dictionary with partial profile details inside [json] key
        '''

        # https://www.meetup.com/meetup_api/docs/members/:member_id/#edit

        title = '%s.update_member_profile' % self.__class__.__name__

        # validate permissions
        if not 'profile_edit' in self.service_scope:
            raise ValueError('%s requires group_join as part of oauth2 service_scope permissions.' % title)

            # validate inputs
        brief_details = self.objects.profile_brief.validate(brief_details)
        profile_details = self.objects.profile.validate(profile_details)

        # construct request fields
        url = '%s/members/%s' % (self.endpoint, str(profile_details['id']))
        params = {
            'bio': profile_details['bio'],
            'bio_privacy': profile_details['privacy']['bio'],
            'fields': 'gender,birthday,last_event,messaging_pref,next_event,other_services,privacy,self,stats',
            'gender': profile_details['gender'],
            'groups_privacy': profile_details['privacy']['groups'],
            'lang': brief_details['lang'].replace('_', '-'),
            'lat': str(profile_details['lat']),
            'lon': str(profile_details['lon']),
            'messaging_pref': profile_details['messaging_pref'],
            'name': profile_details['name'],
            'photo_id': profile_details['photo']['id'],
            'sync_photo': True,
            'topics_privacy': profile_details['privacy']['topics'],
            'zip': brief_details['zip']
        }
        if profile_details['privacy']['facebook']:
            params['facebook_privacy'] = profile_details['privacy']['facebook']
        birthday_value = False
        for key, value in profile_details['birthday'].items():
            if value:
                birthday_value = True
                break
        if not birthday_value:
            params['birthday'] = '-1'
        else:
            birthday_string = ''
            b_day = profile_details['birthday']
            if b_day['day'] and b_day['month']:
                if b_day['month'] < 10:
                    birthday_string += '0'
                birthday_string += str(b_day['month'])
                if b_day['day'] < 10:
                    birthday_string += '0'
                birthday_string += str(b_day['day'])
            birthday_string += str(b_day['year'])
            params['birthday'] = birthday_string

            # send requests
        profile_details = self._patch_request(url, params=params)

        return profile_details
 a method to update user profile details on meetup

        :param brief_details: dictionary with member brief details with updated values
        :param profile_details: dictionary with member profile details with updated values
        :return: dictionary with partial profile details inside [json] key
        
a method to update user profile details on meetup
a method to update user profile details on meetup
def update_member_profile(self, brief_details, profile_details):
        title = '%s.update_member_profile' % self.__class__.__name__
        if not 'profile_edit' in self.service_scope:
            raise ValueError('%s requires group_join as part of oauth2 service_scope permissions.' % title)
        brief_details = self.objects.profile_brief.validate(brief_details)
        profile_details = self.objects.profile.validate(profile_details)
        url = '%s/members/%s' % (self.endpoint, str(profile_details['id']))
        params = {
            'bio': profile_details['bio'],
            'bio_privacy': profile_details['privacy']['bio'],
            'fields': 'gender,birthday,last_event,messaging_pref,next_event,other_services,privacy,self,stats',
            'gender': profile_details['gender'],
            'groups_privacy': profile_details['privacy']['groups'],
            'lang': brief_details['lang'].replace('_', '-'),
            'lat': str(profile_details['lat']),
            'lon': str(profile_details['lon']),
            'messaging_pref': profile_details['messaging_pref'],
            'name': profile_details['name'],
            'photo_id': profile_details['photo']['id'],
            'sync_photo': True,
            'topics_privacy': profile_details['privacy']['topics'],
            'zip': brief_details['zip']
        }
        if profile_details['privacy']['facebook']:
            params['facebook_privacy'] = profile_details['privacy']['facebook']
        birthday_value = False
        for key, value in profile_details['birthday'].items():
            if value:
                birthday_value = True
                break
        if not birthday_value:
            params['birthday'] = '-1'
        else:
            birthday_string = ''
            b_day = profile_details['birthday']
            if b_day['day'] and b_day['month']:
                if b_day['month'] < 10:
                    birthday_string += '0'
                birthday_string += str(b_day['month'])
                if b_day['day'] < 10:
                    birthday_string += '0'
                birthday_string += str(b_day['day'])
            birthday_string += str(b_day['year'])
            params['birthday'] = birthday_string
        profile_details = self._patch_request(url, params=params)
        return profile_details
def update_member_profile ( self , brief_details , profile_details ) : title = '%s.update_member_profile' % self . __class__ . __name__ if not 'profile_edit' in self . service_scope : raise ValueError ( '%s requires group_join as part of oauth2 service_scope permissions.' % title ) brief_details = self . objects . profile_brief . validate ( brief_details ) profile_details = self . objects . profile . validate ( profile_details ) url = '%s/members/%s' % ( self . endpoint , str ( profile_details [ 'id' ] ) ) params = { 'bio' : profile_details [ 'bio' ] , 'bio_privacy' : profile_details [ 'privacy' ] [ 'bio' ] , 'fields' : 'gender,birthday,last_event,messaging_pref,next_event,other_services,privacy,self,stats' , 'gender' : profile_details [ 'gender' ] , 'groups_privacy' : profile_details [ 'privacy' ] [ 'groups' ] , 'lang' : brief_details [ 'lang' ] . replace ( '_' , '-' ) , 'lat' : str ( profile_details [ 'lat' ] ) , 'lon' : str ( profile_details [ 'lon' ] ) , 'messaging_pref' : profile_details [ 'messaging_pref' ] , 'name' : profile_details [ 'name' ] , 'photo_id' : profile_details [ 'photo' ] [ 'id' ] , 'sync_photo' : True , 'topics_privacy' : profile_details [ 'privacy' ] [ 'topics' ] , 'zip' : brief_details [ 'zip' ] } if profile_details [ 'privacy' ] [ 'facebook' ] : params [ 'facebook_privacy' ] = profile_details [ 'privacy' ] [ 'facebook' ] birthday_value = False for key , value in profile_details [ 'birthday' ] . items ( ) : if value : birthday_value = True break if not birthday_value : params [ 'birthday' ] = '-1' else : birthday_string = '' b_day = profile_details [ 'birthday' ] if b_day [ 'day' ] and b_day [ 'month' ] : if b_day [ 'month' ] < 10 : birthday_string += '0' birthday_string += str ( b_day [ 'month' ] ) if b_day [ 'day' ] < 10 : birthday_string += '0' birthday_string += str ( b_day [ 'day' ] ) birthday_string += str ( b_day [ 'year' ] ) params [ 'birthday' ] = birthday_string profile_details = self . _patch_request ( url , params = params ) return profile_details
a method to update user profile details on meetup
a method to update user profile details on meetup
''' a method to update user profile details on meetup

        :param brief_details: dictionary with member brief details with updated values
        :param profile_details: dictionary with member profile details with updated values
        :return: dictionary with partial profile details inside [json] key
        ''' # https://www.meetup.com/meetup_api/docs/members/:member_id/#edit
 # validate permissions
 # validate inputs
 # construct request fields
 # send requests

dictionary with partial profile details inside [json] key
dictionary with partial profile details inside [ json ] key
self
brief_details
dictionary with member brief details with updated values
dictionary with member brief details with updated values
profile_details
dictionary with member profile details with updated values
dictionary with member profile details with updated values