when you use gitea as OAuth2 provider, the /api/v1/user should return
user primary email as identifier, which is unique in OAuth2 clients.
this patch use convert.ToUser replace all u.APIFormat in api requests,
return primary email when caller is yourself or admin.
* Fix syntax highlight initialization
Previously hljs was initialized via a function that relies on the
DOMContentLoaded event, registerd after jQuery's 'ready' event. I assume
that with the recent jQuery update, DOMContentLoaded may not be
guaranteed to fire after 'ready'. Fixed this via vanilla JS initalization.
Fixes: https://github.com/go-gitea/gitea/issues/7559
* semicolon
* don't make release-version deps on transalations since translations is only triggered by push on master (#7496)
* drone/docker: Use a more standard format (#7480)
* drone/docker: Use a more standard format
Based on the plugin drone structure itself : ebce953fc4/.drone.yml (L9)
Use autotag : http://plugins.drone.io/drone-plugins/drone-docker/#autotag
* use latest plugins/docker:linux-amd64
* remove useless cache_from
* Don't depends on translations step
* Fixes#7474 - Handles all redirects for Web UI File CRUD
* Fixes lint errors
* Typo fix
* Adds unit tests for a few helper functions
* Fixes per review
* Fix for new branch creation and to unit test
* Fixes the template used for errors on delete
Regression in 356854fc5f, where
a log.Fatal call was removed. log.Fatal calls os.Exit(1) as intended,
but without it the fail() function returns normally and execution
continues past the fatal error, causing a panic.
This is visible as a go panic log and stack trace returned to the SSH
client, which is not only ugly, it leaks server and build system
information.
Fix by removing the stray return statement so that the fail() function
always calls os.Exit(1).
Backport: 2186a99c76
Fixes: https://github.com/go-gitea/gitea/issues/7457
Signed-off-by: Allen Wild <allenwild93@gmail.com>
* only return head: null if source branch was deleted
* add URL into GetPullRequest
* TestPullRequest_APIFormat
* log error if it is not Err(Branch)NotExist
(cherry picked from commit ff85a6331e)
* issue view - fix icon position
- move style from template to css
- add bullets to: key, circle-slash, comment
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* add border to symbols
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* fix circle slash position
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* fix top margin
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* changed mixed space/tab indent to tabindent only
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* cut timeline length with last element on issue view
fix#7304
- lightly enlight dark theme issue timeline color
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* remove new container
Signed-off-by: Michael Gnehr <michael@gnehr.de>
Previously, only the first return value of ctx.GetSuperSecureCookie
was used to check whether decryption of the auth cookie succeeded.
ctx.GetSuperSecureCookie also returns a second value, a boolean,
indicating success or not. That value should be checked first to
be on the safe side and not rely on internal logic of the encryption
and decryption blackbox.
* workaround broken swagger
only master brach is not working, latest release seems to work
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* make vendor
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* Don't export GO111MODULE
* set go-swagger to fixed release version
mentioned here: https://github.com/go-gitea/gitea/pull/7362#discussion_r300831537
Signed-off-by: Michael Gnehr <michael@gnehr.de>