If the code is messy and dirty, blaming the situation is not correct. No matter what were the restrictions (both time, scope, and cost), your responsibility as a programmer is to deliver the code up to the quality expectations of the project. If you can't do that, you should inform the project beforehand. But don't blame the customer later.
The video is here: https://youtu.be/WKX8CUPuYvo