mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Added group description field to account
This commit is contained in:
1
src/main/resources/update/3_5.sql
Normal file
1
src/main/resources/update/3_5.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE ACCOUNT ADD COLUMN GROUP_DESCRIPTION TEXT;
|
||||||
@@ -19,7 +19,8 @@ trait AccountComponent { self: Profile =>
|
|||||||
val image = column[String]("IMAGE")
|
val image = column[String]("IMAGE")
|
||||||
val groupAccount = column[Boolean]("GROUP_ACCOUNT")
|
val groupAccount = column[Boolean]("GROUP_ACCOUNT")
|
||||||
val removed = column[Boolean]("REMOVED")
|
val removed = column[Boolean]("REMOVED")
|
||||||
def * = (userName, fullName, mailAddress, password, isAdmin, url.?, registeredDate, updatedDate, lastLoginDate.?, image.?, groupAccount, removed) <> (Account.tupled, Account.unapply)
|
val groupDescription = column[String]("GROUP_DESCRIPTION")
|
||||||
|
def * = (userName, fullName, mailAddress, password, isAdmin, url.?, registeredDate, updatedDate, lastLoginDate.?, image.?, groupAccount, removed, groupDescription.?) <> (Account.tupled, Account.unapply)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,5 +36,6 @@ case class Account(
|
|||||||
lastLoginDate: Option[java.util.Date],
|
lastLoginDate: Option[java.util.Date],
|
||||||
image: Option[String],
|
image: Option[String],
|
||||||
isGroupAccount: Boolean,
|
isGroupAccount: Boolean,
|
||||||
isRemoved: Boolean
|
isRemoved: Boolean,
|
||||||
|
groupDescription: Option[String]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -111,7 +111,8 @@ trait AccountService {
|
|||||||
lastLoginDate = None,
|
lastLoginDate = None,
|
||||||
image = None,
|
image = None,
|
||||||
isGroupAccount = false,
|
isGroupAccount = false,
|
||||||
isRemoved = false)
|
isRemoved = false,
|
||||||
|
groupDescription = None)
|
||||||
|
|
||||||
def updateAccount(account: Account)(implicit s: Session): Unit =
|
def updateAccount(account: Account)(implicit s: Session): Unit =
|
||||||
Accounts
|
Accounts
|
||||||
@@ -147,7 +148,8 @@ trait AccountService {
|
|||||||
lastLoginDate = None,
|
lastLoginDate = None,
|
||||||
image = None,
|
image = None,
|
||||||
isGroupAccount = true,
|
isGroupAccount = true,
|
||||||
isRemoved = false)
|
isRemoved = false,
|
||||||
|
groupDescription = None)
|
||||||
|
|
||||||
def updateGroup(groupName: String, url: Option[String], removed: Boolean)(implicit s: Session): Unit =
|
def updateGroup(groupName: String, url: Option[String], removed: Boolean)(implicit s: Session): Unit =
|
||||||
Accounts.filter(_.userName === groupName.bind).map(t => t.url.? -> t.removed).update(url, removed)
|
Accounts.filter(_.userName === groupName.bind).map(t => t.url.? -> t.removed).update(url, removed)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ object AutoUpdate {
|
|||||||
* The history of versions. A head of this sequence is the current BitBucket version.
|
* The history of versions. A head of this sequence is the current BitBucket version.
|
||||||
*/
|
*/
|
||||||
val versions = Seq(
|
val versions = Seq(
|
||||||
|
new Version(3, 5),
|
||||||
new Version(3, 4),
|
new Version(3, 4),
|
||||||
new Version(3, 3),
|
new Version(3, 3),
|
||||||
new Version(3, 2),
|
new Version(3, 2),
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class AccountServiceSpec extends Specification with ServiceSpecBase {
|
|||||||
|
|
||||||
"getAllUsers" in { withTestDB { implicit session =>
|
"getAllUsers" in { withTestDB { implicit session =>
|
||||||
AccountService.getAllUsers() must be like{
|
AccountService.getAllUsers() must be like{
|
||||||
case List(Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false, false)) => ok
|
case List(Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false, false, None)) => ok
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ class AvatarImageProviderSpec extends Specification with Mockito {
|
|||||||
lastLoginDate = None,
|
lastLoginDate = None,
|
||||||
image = image,
|
image = image,
|
||||||
isGroupAccount = false,
|
isGroupAccount = false,
|
||||||
isRemoved = false)
|
isRemoved = false,
|
||||||
|
groupDescription = None)
|
||||||
|
|
||||||
private def createSystemSettings(useGravatar: Boolean) =
|
private def createSystemSettings(useGravatar: Boolean) =
|
||||||
SystemSettings(
|
SystemSettings(
|
||||||
|
|||||||
Reference in New Issue
Block a user