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

fixed record urls #621

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

alimaktabi
Copy link
Collaborator

@alimaktabi alimaktabi commented Sep 13, 2024

Summary by Sourcery

Fix incorrect URL prefixes for images in the TokenDistribution and Raffle models by updating the image names to only include the image ID.

Bug Fixes:

  • Fix incorrect URL prefixes for token and raffle images by extracting and saving only the image ID from the URL.

Copy link
Contributor

sourcery-ai bot commented Sep 13, 2024

Reviewer's Guide by Sourcery

This pull request adds two migration files to fix image URL prefixes for TokenDistribution and Raffle models. The migrations remove the full URL prefix from image fields, leaving only the image ID.

File-Level Changes

Change Details Files
Add migration to fix token image prefixes
  • Create a new migration file for tokenTap app
  • Implement fix_token_images_prefix function to update image fields
  • Update both 'image' and 'token_image' fields for TokenDistribution model
  • Remove 'https://imagedelivery.net' prefix from image URLs
  • Keep only the image ID as the new image name
tokenTap/migrations/0065_fix_token_image_prefix.py
Add migration to fix raffle image URLs
  • Create a new migration file for prizetap app
  • Implement fix_raffle_images_prefix function to update image fields
  • Update 'image' field for Raffle model
  • Remove 'https://imagedelivery.net' prefix from image URLs
  • Keep only the image ID as the new image name
prizetap/migrations/0079_fix_raffle_image_urls.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @alimaktabi - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding error handling and logging to the migration functions. This would make the migrations more robust and easier to troubleshoot if issues arise during execution.
  • If this URL fixing pattern is likely to be repeated for other models, consider creating a more generic function that could be reused across multiple migrations.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@PooyaFekri PooyaFekri merged commit 4b672ea into develop Sep 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants