Commit Graph

10 Commits (3fc1bbe971db0b1591d32c4f561fdccc9c34daf4)

Author SHA1 Message Date
metiftikci aa92b13164
Prevent simultaneous editing of comments and issues ()
fixes  

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)
KN4CK3R c337ff0ec7
Add user blocking ()
Fixes 

This PR adds the abbility to block a user from a personal account or
organization to restrict how the blocked user can interact with the
blocker. The docs explain what's the consequence of blocking a user.

Screenshots:


![grafik](https://github.com/go-gitea/gitea/assets/1666336/4ed884f3-e06a-4862-afd3-3b8aa2488dc6)


![grafik](https://github.com/go-gitea/gitea/assets/1666336/ae6d4981-f252-4f50-a429-04f0f9f1cdf1)


![grafik](https://github.com/go-gitea/gitea/assets/1666336/ca153599-5b0f-4b4a-90fe-18bdfd6f0b6b)

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
JakobDev cf0df023be
More `db.DefaultContext` refactor ()
Part of 

This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
Lunny Xiao 540bf9fa6d
Move notification interface to services layer ()
Extract from 
caicandong 6151e69d95
Delete `issue_service.CreateComment` ()
I noticed that `issue_service.CreateComment` adds transaction operations
on `issues_model.CreateComment`, we can merge the two functions and we
can avoid calling each other's methods in the `services` layer.

Co-authored-by: Giteabot <teabot@gitea.io>
Lunny Xiao b167f35113
Add context parameter to some database functions ()
To avoid deadlock problem, almost database related functions should be
have ctx as the first parameter.
This PR do a refactor for some of these functions.
wxiaoguang de2268ffab
Fix issue attachment handling ()
Close 

Some of the changes are taken from my another fix
f07b0de997
in  (although that PR was discarded ....)


The bug is:

1. The old code doesn't handle `removedfile` event correctly
2. The old code doesn't provide attachments for type=CommentTypeReview


This PR doesn't intend to refactor the "upload" code to a perfect state
(to avoid making the review difficult), so some legacy styles are kept.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
wxiaoguang cfe3d6e9b5
Make more functions use ctx instead of db.DefaultContext ()
Continue the "ctx refactoring" work.

There are still a lot db.DefaultContext, incorrect context could cause
database deadlock errors.
Jason Song 6135359a04
Always reuse transaction ()
Lunny Xiao 68704532c2
Rename almost all Ctx functions ()