Skip to content

Commit

Permalink
fix: changed safequery to normal query in resize image task (fossasia…
Browse files Browse the repository at this point in the history
  • Loading branch information
codedsun committed Dec 22, 2019
1 parent 947b34d commit e1c0c32
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit e1c0c32

Please sign in to comment.