Add name to site creation form, but autopopulate based on title input #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Blocked until a final decision is made on whether or not to allow non-ascii urls, not a high priority yet.
Pre-Flight checklist
What are the relevant tickets?
Closes #128
What's this PR do?
Adds a
name
input field to the site creation form, autopopulates it with a slug based on thetitle
field input, and prevents non-ascii characters from being used.How should this be manually tested?
Go to the form for creating a new site. As you enter a title, the name field below should start to populate. It should contain only lowercase a-z, 0-9, and - characters. If you try to add other characters you should see a validation error. Submit the form, the site should be created with that name/slug.
Where should the reviewer start?
Initially thought about allowing non-ascii characters in the name by passing
allow_unicode=True
todjango.utils.text.slugify
, but after talking with Ferdi & Nathan decided to disallow it and use this approach instead.Screenshots