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

fix: changed safequery to normal query in resize image task #6649

Merged
merged 1 commit into from
Dec 9, 2019
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
4 changes: 2 additions & 2 deletions app/api/helpers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def send_email_task_smtp(payload, smtp_config, headers=None):

@celery.task(base=RequestContextTask, name='resize.event.images', bind=True)
def resize_event_images_task(self, event_id, original_image_url):
event = safe_query(db, Event, 'id', event_id, 'event_id')
event = Event.query.get(event_id)
try:
logging.info('Event image resizing tasks started {}'.format(original_image_url))
uploaded_images = create_save_image_sizes(original_image_url, 'event-image', event.id)
Expand Down Expand Up @@ -172,7 +172,7 @@ def sponsor_logos_url_task(self, event_id):

@celery.task(base=RequestContextTask, name='resize.speaker.images', bind=True)
def resize_speaker_images_task(self, speaker_id, photo_url):
speaker = safe_query(db, Speaker, 'id', speaker_id, 'speaker_id')
speaker = Speaker.query.get(speaker_id)
try:
logging.info('Speaker image resizing tasks started for speaker with id {}'.format(speaker_id))
uploaded_images = create_save_image_sizes(photo_url, 'speaker-image', speaker_id)
Expand Down