This sort of string concatenation is a pet peeve of mine -- can you use a format string?
```python
'/xblock/{loc}/container_preview'.format(loc=locator)
```

Python can concatenate strings using `+` when both sides are strings, but if one is a string and one isn't, it may raise an exception. `str.format()` will implicitly handle converting the arguments to strings if necessary, so it's safer.