Can you use a format string instead? If you're using `secure` instead of `use_https`, it could look something like:
```python
registration_url = "{proto}://{site}{path}".format(
    proto="https" if secure else "http",
    site=stripped_site_name,
    path=reverse('student.views.register_user')
)
```