Conversation
…ing the upload function. Added appropriate unit test.
There was a problem hiding this comment.
I suggest using in here.
There was a problem hiding this comment.
Manne's referring to something along the lines of :
is_thumbnail = (field_name in ["image", "thumb_image", "filmstrip_thumb_image", "filmstrip_image"])
|
Looks like a solid run at it. I think if you hit Manne's notes this should be good to go. If you want to be really proactive, you could do a cleanup remove |
There was a problem hiding this comment.
So we need the other two lines back in here:
this_dir, _ = os.path.split(__file__)
path = os.path.abspath(os.path.expanduser(
os.path.join(this_dir,"sg_logo.jpg")))
as they're used to upload the thumbnail image.
the size variable doesn't actually get used further down.
There was a problem hiding this comment.
Was this test fixed? It looks like it's still broken...
There was a problem hiding this comment.
Looks like I commit before saving the file. Oops...
|
On line 1487, we need to account for the new naming usage as well: Under the new scheme that's not going to get picked up, so the filmstrip will never get uploaded. @manneohrstrom suggests we should possibly use a class variable to identify these 2 sets of fields (for thumbnails and filmstrips). That way we don't run into things like having to comb the code for other instances of the field name's use. |
|
I'll see about making a class variable for these parameters. |
|
Yep, see how we are using Would be nice to define something like Which can then be used in the code: This is useful for clients of the API as well since they too can use the constant. Also - do we need to include the legacy fields? Would be nice to quickly check when they were changed over - I have a feeling it was a long time ago so we should check that... |
|
After looking at it a bit, I don't think having a class variable would be very useful. The 'image' and 'filmstrip_image' are unique fields and one of the point of changing the code was to not have both old and new versions. It would also be non-standardized as only those two specific fields would be user-accessible as constants. The users should have no more reason to use a constant for those two fields than any other field. Thoughts? |
|
Hey there Samuel! I noticed But this PR has been doing quite a few iterations already, maybe we can skip this change for now and try to get this merged instead? Just to keep things moving? :) |
|
Gotcha. I'll go over the next steps tomorrow :) |
…bnail Ticket/34463 upload thumbnail
No description provided.