Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore legacy images in indexing #7003

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def update_user(
cid_metadata[updated_metadata_cid] = updated_metadata
user_record.metadata_multihash = updated_metadata_cid

user_record = update_legacy_user_images(user_record)
user_record = validate_user_record(user_record)
params.add_record(user_id, user_record)
params.challenge_bus.dispatch(
Expand Down Expand Up @@ -537,28 +536,6 @@ def recover_user_id_hash(web3, user_id, signature):
return wallet_address


def update_legacy_user_images(user_record):
# All incoming profile photos intended to be a directory
# Any write to profile_picture field is replaced by profile_picture_sizes
if user_record.profile_picture:
logger.info(
f"index.py | users.py | Processing user profile_picture {user_record.profile_picture}"
)
user_record.profile_picture_sizes = user_record.profile_picture
user_record.profile_picture = None

# All incoming cover photos intended to be a directory
# Any write to cover_photo field is replaced by cover_photo_sizes
if user_record.cover_photo:
logger.info(
f"index.py | users.py | Processing user cover photo {user_record.cover_photo}"
)
user_record.cover_photo_sizes = user_record.cover_photo
user_record.cover_photo = None

return user_record


def validate_user_record(user_record):
if not all_required_fields_present(User, user_record):
raise EntityMissingRequiredFieldError(
Expand Down