-
Notifications
You must be signed in to change notification settings - Fork 55
increase max_length for title #249
Comments
For the SciPy videos, I think it is the length of the generated slug, not the title, that is the problem. I'm looking in to it right now. |
Yes, the slug length was the problem. When creating multiple videos with the same title, the unique counter appended to the slug bumps the entire thing over the max_length of 50 chars. One way to avoid this is to slice out 3 more characters than before, to save room for the slug counter. That's what 4249b8b is doing. |
Two things:
|
|
Hey, I was wondering if you'd rather do something like a query filter where you search for anything where the slug_field starts with the potential slug? If the results are 0, then you know you can use the slug, otherwise, you need to increment the length of the results (unless they are at the sanity check limit you have). |
I'm not sure what you mean by that. Can you put that in code? |
Sure, I was playing around with it last night.
|
also, when I have error messages sometimes I like to provide information about the invalid input, so in this case I might suggest raise ValueError('No valid slugs available for: {}.'.format(text)) But the drawback to this kind of error is that it can throw exceptions itself, etc. so sometimes I include that kind of thing in a debug log statement instead. |
for the counter suffix when handling collisions. handles pyvideo#249
let me know if #269 is satisfactory |
I've had a couple of videos before that had long titles and I think we hit another set with SciPy. We should increase the max_length to 100 characters or something.
The text was updated successfully, but these errors were encountered: