Commit 55ba8ad0 by woodsaj

fix issue 1481. correctly escape api_key.key column name

'key' is a reserved word in mysql. So when building a query,
the api-key.key column name needs to be escaped
parent 6263ec1d
......@@ -66,7 +66,7 @@ func UpdateApiKey(cmd *m.UpdateApiKeyCommand) error {
func GetApiKeyByKey(query *m.GetApiKeyByKeyQuery) error {
var apikey m.ApiKey
has, err := x.Where("key=?", query.Key).Get(&apikey)
has, err := x.Where("`key`=?", query.Key).Get(&apikey)
if err != nil {
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment