summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Use ID or Where to instead directly use Get when load object from database ↵65432020-06-179-29/+25
| | | | | | | | | (#11925) (#11935) Backport #11925 Use ID or Where to instead directly use Get when load object from database Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix verification of subkeys of default gpg key (#11713) (#11902)zeripath2020-06-151-0/+15
| | | | | | | | | | | | | | | | | | | | | Backport #11713 * Fix verification of subkeys of default gpg key Fix #10309 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove debug log * Update models/gpg_key.go * As per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [Workaround] doctor xorm.Count nil on sqlite error (#11741)65432020-06-091-0/+21
| | | | | | | * make it similar to v1.12&master * workaround from xorm bug * CI.restart()
* Fix wrong milestone in webhook message (#11596) (#11612)Gary Kim2020-05-251-1/+1
| | | | | Backport of #11596 Signed-off-by: Gary Kim <gary@garykim.dev>
* Ensure public repositories in private organizations are visible and fix ↵65432020-05-171-4/+25
| | | | | | | admin organizations list (#11465) (#11475) Partial Backport of #11465 Co-authored-by: zeripath <art27@cantab.net>
* Allow all members of private orgs to see public repos (#11442) (#11459)zeripath2020-05-171-25/+23
| | | | | | | | | | | | | | | | | * Allow all members of private orgs to see public repos (#11442) Backport (#11442) Allow all members of private orgs to see public repos Fix #10144 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update models/repo_list.go * Oops missed the repos we own! Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use session for retrieving org teams (#11438) (#11439)guillep2k2020-05-171-1/+1
| | | Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
* Fix tracked time issues (#11349) (#11354)guillep2k2020-05-091-4/+6
| | | | | | | | | | | | | | | | | | Backport #11349 * Fix tracked time issues (#11349) * Fix nil exeption: #11313 * fix 500 * activate test 😆 * move logic * Add missing import Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
* Allow X in addition to x in tasks (#10979) (#11335)zeripath2020-05-081-2/+2
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent multiple listings of organization when creating a repository ↵65432020-05-071-6/+6
| | | | | | | | | | | | | | | | | | (#11303) (#11325) Backport #11303 Prevent multiple listings of organization when creating a repository (#11303) prevent double entries in results of GetOrgsCanCreateRepoByUserID I first try to only add GroupBy directly but xorm return broken user objects ... ... solution was to just query related UserIDs(OrgIDs) first and return OrgUsers based on this IDs close #11258 Co-authored-by: zeripath <art27@cantab.net>
* On Repo Deletion: Delete related TrackedTimes too (#11110) (#11125)65432020-04-191-0/+5
|
* [Backport] Fix release counter on API repository info (#10968) (#10996)65432020-04-061-2/+3
| | | | | * Fix release counter on API repository info (#10968) * correct Pull Count to v1.11 Fixtures
* Mulitple Gitea Doctor improvements (#10943) (#10990) (#10064) (#9095) (#10991)zeripath2020-04-064-21/+172
| | | | | | | | | | | | | | | | | | | | | | * Mulitple Gitea Doctor improvements (#10943) Backport #10943 * Add `gitea doctor --list` flag to list the checks that will be run, including those by default * Add `gitea doctor --run` to run specific checks * Add `gitea doctor --all` to run all checks * Add db version checker * Add non-default recalculate merge bases check/fixer to doctor * Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319) * Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.) * Add SCRIPT_TYPE check (Fix #10977) * Add `gitea doctor --fix` to attempt to fix what is possible to easily fix * Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.) Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch to io.Writer instead of io.StringWriter Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix milestones too many SQL variables bug (#10880) (#10904)Lunny Xiao2020-03-313-24/+81
| | | | | | | | | * Fix milestones too many SQL variables bug * Fix test * Don't display repositories with no milestone and fix tests * Remove unused code and add some comments
* Protect against NPEs in notifications list (#10879) (#10883)zeripath2020-03-301-19/+58
| | | | | | | | | | | | | | | | | | | | | | * Protect against NPEs in notifications list (#10879) Unfortunately there appears to be potential race with notifications being set before the associated issue has been committed. This PR adds protection in to the notifications list to log any failures and remove these notifications from the display. References #10815 - and prevents the panic but does not completely fix this. Signed-off-by: Andrew Thornton <art27@cantab.net> * add log import * Update models/notification.go Co-Authored-By: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* account for empty lines in receive-hook message (#10773) (#10784)zeripath2020-03-211-1/+1
| | | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix bug on branch API (#10767) (#10775)Lunny Xiao2020-03-201-0/+22
| | | | | * Fix bug on branch API (#10767) * Fix branch api canPush and canMerge
* Delete dependencies when deleting a repository (#10608) (#10616)zeripath2020-03-051-0/+12
| | | | | | | | Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net>
* Admin page for managing user e-mail activation (#10557) (#10579)guillep2k2020-03-022-16/+335
| | | | | | | | | | | | | | | | | | * Admin page for managing user e-mail activation (#10557) * Implement mail activation admin panel * Apply suggestions by @lunny * Add UI for user activated emails * Prevent admin from self-deactivate; add modal Co-authored-by: zeripath <art27@cantab.net> * Fix pagination options downgrade Co-authored-by: zeripath <art27@cantab.net>
* Fix migration bug on v96.go (#10572) (#10573)guillep2k2020-03-021-16/+31
| | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Show Signer in commit lists and add basic trust (#10425) (#10524)zeripath2020-02-282-3/+60
| | | | | | | | | | | | | | | | | | | | | | | | Backport #10425 Backport #10511 * Show Signer in commit lists and add basic trust (#10425) Show the avatar of the signer in the commit list pages as we do not enforce that the signer is an author or committer. This makes it clearer who has signed the commit. Also display commits signed by non-members differently from members and in particular make it clear when a non-member signer is different from the committer to help reduce the risk of spoofing. Signed-off-by: Andrew Thornton <art27@cantab.net> Fix the signing icon in the view_list.tmpl page (#10511) Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix potential bugs (#10513) (#10518)65432020-02-283-3/+7
| | | | | | * use e if it is an option * potential nil so check err first * check err first * m == nil already checked
* [BugFix] Avoid mailing explicit unwatched (#10475) (#10500)65432020-02-271-4/+8
| | | * [BugFix] Avoid mailing explicit unwatched (#10475)
* Handle push rejection message in Merge & Web Editor (#10373) (#10497)zeripath2020-02-271-0/+48
| | | | | | | | | | | | | | Backport #10373 * Handle push rejection message in Merge * Fix sanitize, adjust message handling * Handle push-rejection in webeditor CRUD too Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368) (#10493)guillep2k2020-02-261-1/+1
|
* Show the username as a fallback on feeds if full name is blank (#10461)James Lakin2020-02-262-5/+10
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Various fixes in login sources (#10428) (#10429)zeripath2020-02-234-15/+38
| | | | Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Ensure only own addresses are updated (#10397) (#10399)guillep2k2020-02-212-2/+2
|
* Fix wrong num closed issues on repository when close issue via commit ↵Lunny Xiao2020-02-201-0/+4
| | | | | | | | (#10364) (#10380) Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Reading pull attachments should depend on read UnitTypePullRequests (#10346) ↵guillep2k2020-02-182-2/+6
| | | | | | (#10354) Co-authored-by: zeripath <art27@cantab.net>
* Blacklist manifest.json & milestones user (#10292) (#10293)zeripath2020-02-161-0/+2
| | | | | | Fix #10290 Co-authored-by: techknowlogick <matti@mdranta.net>
* Repo name added to automatically generated commit message when mergin… ↵zeripath2020-02-151-1/+10
| | | | | | | | | | | (#9997) (#10285) * Repo name added to automatically generated commit message when merging pull request * As per @lunny Co-authored-by: Shashvat Kedia <sk261@snu.edu.in> Co-authored-by: Lauris BH <lauris@nix.lv>
* Divide GetIssueStats query in smaller chunks (#10176) (#10282)guillep2k2020-02-152-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | * Divide GetIssueStats query in smaller chunks * Skip chunking if count is low enough * Fix lint * Define maxQueryParameters * Remove absMaxQueryParameters because of lint * Restart CI * Restart CI Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Only check for conflicts/merging if the PR has not been merged in the ↵65432020-02-101-18/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interim (#10132) (#10206) * Only check for conflicts/merging if the PR has not been merged in the interim (#10132) * Only check for merging if the PR has not been merged in the interim * fixup! Only check for merging if the PR has not been merged in the interim * Try to fix test failure * Use PR2 not PR1 in tests as PR1 merges automatically * return already merged error * enforce locking * move pullrequest checking to after merge This might improve the chance that the race does not affect us but does not prevent it. * Remove minor race with getting merge commit id move check pr after merge * Remove unnecessary prepareTestEnv - onGiteaRun does this for us * Add information about when merging occuring * More logging Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * re order Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* [BugFix] [API] Pull.API.Convert: Only try to get HeadBranch if HeadRepo ↵65432020-01-311-29/+32
| | | | exist (#10029) (#10088)
* Update topics repo count when deleting repository (#10081)Lauris BH2020-01-312-3/+27
|
* Fix milestone API state parameter unhandled (#10049) (#10052)Lunny Xiao2020-01-292-4/+25
| | | | | * Fix milestone API state parameter unhandled * Fix test
* Ensure that feeds are appropriately restricted (#10018) (#10019)zeripath2020-01-282-0/+19
| | | | | | * Ensure that feeds are appropriately restricted * Placate golangci-lint
* trim whitespace of MilestoneName at creation/rename (#10017) (#10034)65432020-01-282-2/+7
|
* Sanitize credentials in mirror form (#9975) (#9991)Lunny Xiao2020-01-261-0/+8
|
* Fix pull view when head repository or head branch missed and close related ↵Lunny Xiao2020-01-251-1/+5
| | | | | | | | | | | | | | | | | | | | pull requests when delete head repository or head branch (#9927) (#9974) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fixed repo link in generated comment for cross repository dependency (#9863) ↵65432020-01-221-0/+5
| | | | | | | | | | | | | (#9935) * fixed link to issue in issue comments after adding/removing a dependency, before links assumed the issue was in the same repository. also changed the format of the displayed issue since the issue will not necessarily be in the same repo * based on pr comments, changed to use HTMLURL instead of piecing together the issue url, and added an if statement around the issue link display as a nil protection * only showing repo name in dependency comment if the issue is from another repo Co-authored-by: Brad Albright <32200834+bhalbright@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Fix wrong hint when status checking is running on pull request view (#9886) ↵Lunny Xiao2020-01-222-51/+19
| | | | | | | | | | | | | | | | | (#9928) * Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name
* Do not try to recreate ldap user if they are already created (#9900) (#9919)zeripath2020-01-211-12/+12
| | | | | | | | | | * Do not try to recreate ldap user if they are already created * just remove autoregister Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <matti@mdranta.net>
* Add option to prevent LDAP from deactivating everything on empty search ↵zeripath2020-01-201-0/+9
| | | | | | | | | | | (#9879) (#9896) * Add option to prevent LDAP from deactivating everything on empty search * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Check user != nil before checking values (#9881) (#9883)65432020-01-191-7/+15
| | | | | | | | * Check user != nil before checking values * Handle autoAdmin Co-authored-by: zeripath <art27@cantab.net>
* Explicitly refer to PR in squash-merge commit message in case of external ↵David Svantesson2020-01-181-0/+7
| | | | | | | | | | | | tracker (#9844) (#9855) * Explicitly refer to PR in squash-merge commit message in case of external tracker * documentation Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Fix wrong identify poster on a migrated pull request when submi… (#9827) ↵Lunny Xiao2020-01-171-1/+1
| | | | (#9830)
* Move Errored PRs out of StatusChecking (#9675) (#9726)zeripath2020-01-121-1/+2
| | | | | | | | | | | | | | | | | | * Move Errored PRs out of StatusChecking (#9675) * Set Errored PRs out of StatusChecking * Ensure that api status is correctly set too * Update models/pull.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update services/pull/check.go Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>
* Never allow an empty password to validate (#9682) (#9683)zeripath2020-01-111-1/+1
| | | | | | | | * Restore IsPasswordSet previous value * Update models/user.go Co-authored-by: Lauris BH <lauris@nix.lv>