Object of type Response is not JSON serializable

This commit is contained in:
Eriks K 2020-05-14 16:41:18 +03:00
parent 09c6255b84
commit a208c8bcf0
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@
__author__ = """Eriks Karls"""
__email__ = 'eriks@72.lv'
__version__ = '0.20.0'
__commit_id__ = "ff2a0e0"
__commit_id__ = "09c6255"
from erepublik import classes, utils
from erepublik.citizen import Citizen

View File

@ -728,7 +728,7 @@ class CitizenTravel(BaseCitizen):
r = self._travel(self.details.residence_country, self.details.residence_region)
if r.json().get('message', '') == 'success':
self._update_citizen_location(self.details.residence_country, self.details.current_region)
self._report_action("TRAVEL", "Traveled to residence", response=r)
self._report_action("TRAVEL", "Traveled to residence", response=r.json())
return True
return False
return True
@ -741,7 +741,7 @@ class CitizenTravel(BaseCitizen):
r = self._travel(data.get('preselectCountryId'), region_id).json()
if r.get('message', '') == 'success':
self._update_citizen_location(data.get('preselectCountryId'), region_id)
self._report_action("TRAVEL", "Traveled to region", response=r)
self._report_action("TRAVEL", "Traveled to region", response=r.json())
return True
return False
@ -758,7 +758,7 @@ class CitizenTravel(BaseCitizen):
r = self._travel(country_id, region_id).json()
if r.get('message', '') == 'success':
self._update_citizen_location(country_id, region_id)
self._report_action("TRAVEL", f"Traveled to {utils.COUNTRIES[country_id]}", response=r)
self._report_action("TRAVEL", f"Traveled to {utils.COUNTRIES[country_id]}", response=r.json())
return True
return False
@ -770,7 +770,7 @@ class CitizenTravel(BaseCitizen):
r = self._travel(data.get('preselectCountryId'), data.get('preselectRegionId')).json()
if r.get('message', '') == 'success':
self._update_citizen_location(data.get('preselectCountryId'), data.get('preselectRegionId'))
self._report_action("TRAVEL", f"Traveled to holding {holding_id}", response=r)
self._report_action("TRAVEL", f"Traveled to holding {holding_id}", response=r.json())
return True
return False