From ebf375ca1eb7e5b0c82277b4ff5316ab0bdd2689 Mon Sep 17 00:00:00 2001 From: Phil Gyford Date: Mon, 14 Feb 2022 11:10:31 +0000 Subject: [PATCH] Don't add the `protected` info to the user data when importing tweet data (a) because we can't get it from the downloaded archive https://twittercommunity.com/t/download-archive-does-not-include-current-protected-status/166622 and (b) because that value should be set when saving the Account object, which fetches the User data from Twitter before the import. For #229 --- ditto/twitter/ingest.py | 2 -- tests/twitter/test_ingest_v2.py | 1 - 2 files changed, 3 deletions(-) diff --git a/ditto/twitter/ingest.py b/ditto/twitter/ingest.py index 41a68e10..663fc660 100644 --- a/ditto/twitter/ingest.py +++ b/ditto/twitter/ingest.py @@ -281,8 +281,6 @@ def _construct_user_data(self, directory): "name": account_data[0]["account"]["accountDisplayName"], "profile_image_url_https": profile_data[0]["profile"]["avatarMediaUrl"], "verified": verified_data[0]["verified"]["verified"], - # TODO: - "protected": False, # So that we don't mistake this for coming from the API when # we save the JSON: "ditto_note": ( diff --git a/tests/twitter/test_ingest_v2.py b/tests/twitter/test_ingest_v2.py index 7657ffae..119fc304 100644 --- a/tests/twitter/test_ingest_v2.py +++ b/tests/twitter/test_ingest_v2.py @@ -54,7 +54,6 @@ def test_saves_user_data(self): "name": "Phil Gyford", "profile_image_url_https": "https://pbs.twimg.com/profile_images/1167616130/james_200208_300x300.jpg", # NOQA: E501 "verified": False, - "protected": False, "ditto_note": ( "This user data was compiled from separate parts of a " "downloaded twitter archive by Django Ditto"