From 68a410c4f2fb7204a90adfa22250dd59b04edeb1 Mon Sep 17 00:00:00 2001 From: "Mikhail Andreev (adw0rd)" Date: Tue, 28 Dec 2021 08:46:02 +0100 Subject: [PATCH] [BUG] Changing phone_number got KeyError: full_name [#514] Fixed --- instagrapi/mixins/account.py | 6 ++++-- setup.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/instagrapi/mixins/account.py b/instagrapi/mixins/account.py index 41e335f3..d72d29bd 100644 --- a/instagrapi/mixins/account.py +++ b/instagrapi/mixins/account.py @@ -110,8 +110,10 @@ def account_edit(self, **data: Dict) -> Account: user_data = self.account_info().dict() user_data = {field: user_data[field] for field in fields} data = dict(user_data, **data) - # Instagram original field-name for full user name is "first_name" - data["first_name"] = data.pop("full_name") + full_name = data.pop("full_name", None) + if full_name: + # Instagram original field-name for full user name is "first_name" + data["first_name"] = full_name # Biography with entities (markup) result = self.private_request("accounts/edit_profile/", self.with_default_data(data)) biography = data.get("biography") diff --git a/setup.py b/setup.py index 79be19a9..da874b9c 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( name='instagrapi', - version='1.16.7', + version='1.16.8', author='Mikhail Andreev', author_email='x11org@gmail.com', license='MIT',