fossasia / open-event-server

Formatted string passed to logging module PYL-W1203
Performance
Minor
5 months agoa year old
Use lazy % formatting in logging functions
668                charge.failure_message, charge.failure_code
669            ),
670        )
671    logging.info(f"Successful charge: {charge.id}.  Order ID: {order_identifier}")672
673    return redirect(make_frontend_url(f'orders/{order_identifier}/view'))
674
Use lazy % formatting in logging functions
650    try:
651        charge = OmisePaymentsManager.charge_payment(order_identifier, token)
652    except omise.errors.BaseError as e:
653        logging.exception(654            f"""OmiseError: {repr(e)}.  See https://www.omise.co/api-errors"""
655        )
656        return jsonify(status=False, error=f"Omise Failure Message: {str(e)}")
Use lazy % formatting in logging functions
311        speaker.thumbnail_image_url = uploaded_images['thumbnail_image_url']
312        speaker.icon_image_url = uploaded_images['icon_image_url']
313        save_to_db(speaker)
314        logging.info(315            f'Resized images saved successfully for speaker with id: {speaker_id}'
316        )
317    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL):
Use lazy % formatting in logging functions
286    sponsors = Sponsor.query.filter_by(event_id=event_id, deleted_at=None).all()
287    for sponsor in sponsors:
288        try:
289            logging.info(f'Sponsor logo url generation task started {sponsor.logo_url}')290            new_logo_url = create_save_resized_image(
291                image_file=sponsor.logo_url, resize=False
292            )
Use lazy % formatting in logging functions
272        user.thumbnail_image_url = uploaded_images['thumbnail_image_url']
273        user.icon_image_url = uploaded_images['icon_image_url']
274        save_to_db(user)
275        logging.info(f'Resized images saved successfully for user with id: {user_id}')276    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL):
277        logging.exception(
278            'Error encountered while generating resized images for user with id: {}'.format(