Commit graph

131 commits

Author SHA1 Message Date
SagePtr
303d7f7e9c Do not autocreate directory for new user/orgs () () 2018-09-06 20:40:58 -04:00
SagePtr
ac968c3c6f Fix out-of-transaction query in removeOrgUser () () 2018-07-27 02:41:36 +03:00
Lauris BH
0c59edaafa Update xorm to latest version and fix correct user table referencing in sql () 2018-07-20 10:10:17 +08:00
David Schneiderbauer
0b3ea42847 hide issues from org private repos w/o team assignment () 2018-06-21 12:00:13 -04:00
Wendell Sun
2d1c5c3756 Fix remove team member issue ()
Put sess.Commit() out of the RemoveOrgUser function

Add an empty line to separate import packages
2018-02-23 16:42:02 +08:00
Ethan Koenig
f48680888c Remove IsOwner, NumTeams from OrgUser () 2018-01-08 09:48:37 +02:00
Ethan Koenig
515cdaa85d Fix ignored errors when checking if organization, team member () 2017-12-21 09:43:26 +02:00
Lunny Xiao
859b9ad7ea fix org owner cannot be removed if there is not in owner team () 2017-12-13 00:26:31 +02:00
Lunny Xiao
6eeadb2082 Hide unactive on explore users and some refactors ()
* hide unactive on explore users and some refactors

* fix test for removed Organizations

* fix test for removed Organizations

* fix imports

* fix logic bug

* refactor the toConds

* Rename TestOrganizations to TestSearchUsers and add tests for users

* fix other tests

* fix other tests

* fix watchers tests

* fix comments and remove unused code
2017-10-24 20:36:19 +03:00
Ethan Koenig
aa962deec0 Replace deprecated Id method with ID () 2017-10-05 07:43:04 +03:00
Lunny Xiao
dd55534b82 Reduce usage of allcols on update ()
* reduce usage of allcols on update

* fix bug and tests
2017-09-25 12:59:27 +08:00
Ethan Koenig
4cb9394a97 Fix lint errors () 2017-09-19 11:08:30 +03:00
bradder555
ad24a3134d Fixes 500 error on dashboard when using MSSQL ()
MSSQL rejects the query:
  SELECT "repository"."id" FROM "repository"
  INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND
  "repository".is_mirror=1
  WHERE (
    ("repository".owner_id=2 AND "repository".is_private=0)
        OR team_repo.team_id IN (1)
        )
        GROUP BY "repository".id ORDER BY updated_unix DESC

when the order by term (updated_unix) is not included in the group by
term.
2017-09-15 09:14:06 +03:00
Lunny Xiao
1739e84ac0 improve protected branch to add whitelist support ()
* improve protected branch to add whitelist support

* fix lint

* fix style check

* fix tests

* fix description on UI and import

* fix test

* bug fixed

* fix tests and languages

* move isSliceInt64Eq to util pkg; improve function names & typo
2017-09-14 16:16:22 +08:00
Antoine GIRARD
30787e48f2 Improve org error handling ()
* Improve ErrOrgNotExist type
Return new error type
Use good error check
Use new method to check error
Update tests

* Fix unchanged method name report
2017-07-06 21:30:19 +08:00
Lauris BH
6db387a21e Refactor session close as xorm already does everything needed internally () 2017-06-21 08:57:05 +08:00
Ethan Koenig
036ce3f813 Fix bug in removeOrgRepo () 2017-06-02 20:06:09 -05:00
Ethan Koenig
336e311a7c Fix locking bug in removeOrgRepo () 2017-06-01 08:41:14 +08:00
Ethan Koenig
39348cd27e Give all units to owner team () 2017-05-26 16:03:37 +08:00
Lunny Xiao
5acfc7c4bc fix migrate failed and org dashboard failed on MSSQL database () 2017-04-06 18:47:25 -07:00
Lunny Xiao
5d40db629c fix random avatars () 2017-03-08 23:05:15 +08:00
Lunny Xiao
0376029241 fix del org avatar potential delete all avtars () 2017-03-06 16:07:18 +08:00
Ethan Koenig
76057105ca Remove unnecessary loads in org_team () 2017-02-24 14:25:09 +08:00
Lunny Xiao
9c645b54dc bug fixed on issues and pulls 2017-02-15 01:17:07 +01:00
Lunny Xiao
4cfde304df bug fixed for my repository () 2017-02-14 23:37:44 +08:00
Lunny Xiao
55ae78208e Small optimization for getTeamIDs ()
* small optimization for getTeamIDs

* rename getOrgTeamIDs to getUserTeamIDs and remove orderby
2017-02-14 11:46:46 +08:00
Ethan Koenig
f82ea42679 Fix bug in removeOrgRepo 2017-02-04 11:01:21 -05:00
Gabriel Jackson
bf6f61cc69 Cleanup log messaging
This change corrects a few logging issues:

 * Standardized formatting errors with '%v'.
 * Standardized failure warning word usage.
 * Corrected an instance of using the standard log library when
   the gitea log library should be used instead.
2017-02-02 15:24:18 +01:00
Ethan Koenig
a2412492da Unit tests and bug fix for models/org 2017-01-27 12:24:06 -05:00
Lunny Xiao
bb5a6b7a07 fix xorm NewSession uncorrected usages () 2017-01-28 00:11:41 +08:00
Ethan Koenig
da1b6164fe Fix FIXME and remove superfluous queries in models/org () 2017-01-25 23:41:38 +08:00
btrepp
302fa42980 Removes reliance on server specific SQL ()
Breaks the retrieval of repositories into two queries
This fetches the paged ids in one go, then the
actual repository information in a second query

Some databases do not support SELECT with *
when group by is used.
2017-01-14 22:32:36 +08:00
Bo-Yi Wu
cbf2a967c5 refactor: Add new deleteOrg func. () 2017-01-11 21:10:43 +08:00
Andrey Nering
84b7d29d34 Create missing database indexes () 2017-01-06 23:14:33 +08:00
Lunny Xiao
09dabe2ff2 fix bug () 2017-01-03 16:27:11 +08:00
Schwobaland
c0904f1942 Restrict creating organisations by user ()
* restrict creating organizations based on right on user

* revert bindata.go

* reverse vendor lib

* revert goimports change

* set AllowCreateOrganization default value to true

* revert locale

* added default value for AllowCreateOrganization

* fix typo in migration-comment

* fix comment

* add coments in migration
2016-12-31 10:33:30 +08:00
Lunny Xiao
799d0c2030 slight optimization for GetUserRepositories () 2016-12-29 02:53:33 -06:00
Lunny Xiao
ba134bd27a fix 500 when delete orgnization and resolved 2016-12-27 12:00:12 +01:00
Bwko
fa3abc22c0 Added sorting to organizations, repos & users page () 2016-12-24 22:42:26 +08:00
Denis Denisov
380e32e129 Fix random string generator ()
* Remove unused custom-alphabet feature of random string generator

Fix random string generator

Random string generator should return error if it fails to read random data via crypto/rand

* Fixes variable (un)initialization mixed assign
Update test GetRandomString
2016-12-20 13:32:02 +01:00
Lunny Xiao
21846d16e5 golint for models/org_team.go 2016-11-28 09:30:08 +08:00
Bwko
a4ece1f223 Fixes typos 2016-11-27 12:59:12 +01:00
Bwko
0b9cf10340 Lint models/org.go & models.go 2016-11-26 11:37:50 +01:00
Lunny Xiao
ade6d4a20f optimization on database IN 2016-11-12 01:31:37 +08:00
Lunny Xiao
9bf28a2799 bug fixed for 500 caused by get org users () 2016-11-12 00:55:06 +08:00
Thibault Meyer
b12f2a5916
Remove unused import 2016-11-10 21:10:25 +01:00
Thibault Meyer
b0ddced2b5
Merge remote-tracking branch 'upstream/master' into feature/rewrite-xorm-queries
# Conflicts:
#	models/git_diff.go
#	models/issue.go
#	models/org.go
#	models/pull.go
#	models/repo.go
2016-11-10 21:05:52 +01:00
Thibault Meyer
a4454f5d0f
Rewrite XORM queries 2016-11-10 20:59:51 +01:00
Sandro Santilli
4247304f5a Update import paths from github.com/go-gitea to code.gitea.io ()
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
2016-11-10 17:24:48 +01:00
Lunny Xiao
c6c840faf7 Merge pull request from lunny/lunny/SQL_instead_Sql
use x.SQL instead of x.Sql
2016-11-10 17:12:14 +08:00