chidioguejiofor/airtech-api

View on GitHub
airtech_api/utils/error_messages/serialization_errors.py

Summary

Maintainability
A
0 mins
Test Coverage
msg_dict = {
    'resource_not_found':
    'The resource you specified was not found',
    'invalid_gender':
    "The gender you specified is invalid!!",
    'many_invalid_fields':
    'Some errors occured while validating some fields. Please check and try again',
    'unique':
    'The {} you inputted already exists',
    'user_not_found':
    'The user with that username/email and password combination was not found',
    'email_not_found':
    'A user with email `{}` does not exist',
    'user_already_verified':
    'The user with that email has already been verified',
    'invalid_flight_type':
    'Flight type must be either international or local',
    'invalid_flight_schedule':
    'Flight schedule must be at least 12 hours before it is created',
    'resource_id_not_found':
    'The {} with that id was not found',
    'user_book_flight_twice':
    'You had previously booked for this Flight and thus cannot do it again',
    'flight_booking_expired':
    'You cannot book for a flight less than 24 hours before the flight',
    'flight_schedule_expired':
    'The schedule of this flight has already passed and thus you cannot book it',
    'missing_field':
    'You forgot to include this field',
    'value_not_a_file':
    'The value you inputted is not a file',
    'not_an_image':
    'The file you uploaded is not a valid image',
    'image_too_large':
    'Image must not be more than 2MB',
    'payment_link_error':
    'An error occurred while creating payment link',
    'booking_already_paid':
    'You have already paid for this flight',
    'booking_expired':
    'Your booking has expired, thus you cannot pay for this ticket',
    'invalid_url':
    'The `{}` field must be a valid URL with protocols `http` or `https`',
    "invalid_url_field":
    'This field must be a valid URL with protocols `http` or `https`',
    'paystack_threw_error':
    "There was an unexpected error while processing request. "
    "Please raise this as an issue in at "
    "https://github.com/chidioguejiofor/airtech-api/issues",
    'empty_request':
    'You did not specify any `{}` data in your request',
    'paid_booking_cannot_be_deleted':
    'You cannot delete this Booking because you have already paid for it',
    'cannot_delete_expired_booking':
    'You cannot delete an expired booking',
    'cannot_delete_flight_with_bookings':
    'You cannot delete this flight because users have started booking it',
    'cannot_delete_flight_that_has_flown':
    'You cannot delete this flight because the schedule date has been passed',
    'cannot_update_flight_field_with_bookings':
    'You cannot update the `{}` of this flight because it has already been booked',
    'cannot_update_field':
    'You cannot update a {} {}',
    'regular_user_only':
    'This endpoint is for only regular users',
    'profile_not_updated':
    'You need to update your profile picture before you can do this',
    'only_alpha_and_numbers':
    'This field can contain only alphabets and numbers'
}