Strip colons in template variable names before saving

pull/1304/head
Luke Morris 2017-04-28 12:38:05 -07:00
parent 3db76639e6
commit 6693b759cb
1 changed files with 4 additions and 2 deletions

View File

@ -115,7 +115,9 @@ const TemplateVariableRow = ({
onErrorThrown, onErrorThrown,
}) => ( }) => (
<form <form
className={classNames('template-variable-manager--table-row', {editing: isEditing})} className={classNames('template-variable-manager--table-row', {
editing: isEditing,
})}
onSubmit={onSubmit({ onSubmit={onSubmit({
selectedType, selectedType,
selectedDatabase, selectedDatabase,
@ -246,7 +248,7 @@ class RowWrapper extends Component {
notify, notify,
} = this.props } = this.props
const _tempVar = e.target.tempVar.value const _tempVar = e.target.tempVar.value.replace(/\u003a/g, '')
const tempVar = `\u003a${_tempVar}\u003a` // add ':'s const tempVar = `\u003a${_tempVar}\u003a` // add ':'s
if (tempVarAlreadyExists(tempVar, id)) { if (tempVarAlreadyExists(tempVar, id)) {