Quantcast
Viewing latest article 30
Browse Latest Browse All 40

Upload managers (S3Client, FileClient) now receive a user ID as argument,...

Upload managers (S3Client, FileClient) now receive a user ID as argument, instead of a user instance. This way they can operate on uploaded files even if the user has been deleted. The User ID is part of the filename (or key in the S3 case), and that's all the managers need to operate on files. It's better to pass the ID directly instead of the user instance; if the user has been deleted, an error would be raised when trying to obtain his ID and the operation would fail. This gets rid of "NoMethodError: undefined method 'id' for nil:nilClass" error in ImportOpmlWorker, which happened when the worker tried to delete the file uploaded by a user that has already been deleted before the worker runs.

Viewing latest article 30
Browse Latest Browse All 40

Trending Articles