Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last Login for admin manage your users #121

Merged
merged 1 commit into from
Nov 10, 2016
Merged

Last Login for admin manage your users #121

merged 1 commit into from
Nov 10, 2016

Conversation

joubertredrat
Copy link
Contributor

@joubertredrat joubertredrat commented Nov 8, 2016

This PR fixes #57

PS: Thanks @lunny for help on final with i18n.

screenshot-localhost 3000 2016-11-08 12-02-26

@thibaultmeyer
Copy link
Contributor

Good job, maybe you could try to rebase your commits into one commit ?

@@ -119,6 +121,10 @@ func (u *User) BeforeUpdate() {
u.UpdatedUnix = time.Now().Unix()
}

func (u *User) AfterLogin() {
Copy link
Contributor

@thibaultmeyer thibaultmeyer Nov 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe UpdateLastLogin will be a more appropriate name for this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xBAADF00D I chose this name because it is generic, it may be that in the future another implementation can be done in this same method. But I can change if is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@joubertredrat
Copy link
Contributor Author

@0xBAADF00D I can provide this, but Isn't it better to keep? Because first commit references the implementation on the route, while the last commit describes changes in the admin panel.

@codecov-io
Copy link

codecov-io commented Nov 8, 2016

Current coverage is 3.14% (diff: 0.00%)

Merging #121 into master will decrease coverage by <.01%

@@            master      #121   diff @@
========================================
  Files           33        33          
  Lines         7823      7827     +4   
  Methods          0         0          
  Messages         0         0          
  Branches         0         0          
========================================
  Hits           246       246          
- Misses        7557      7561     +4   
  Partials        20        20          

Powered by Codecov. Last update 475ddd8...f91cbf0

Copy link
Member

@DblK DblK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing comments for linting

@@ -119,6 +121,10 @@ func (u *User) BeforeUpdate() {
u.UpdatedUnix = time.Now().Unix()
}

func (u *User) AfterLogin() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide some comments for the linting of your function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

func (u *User) AfterLogin() {
u.LastLoginUnix = time.Now().Unix()
}

func (u *User) AfterSet(colName string, _ xorm.Cell) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment for the function for the linting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@metalmatze
Copy link
Contributor

I think you can keep your commits. Please make sure that your PRs are rebased once they're going to be merged, but that's it. You just need to squash if you feel like it's a good idea, but we don't force you to.

@joubertredrat
Copy link
Contributor Author

joubertredrat commented Nov 8, 2016

@metalmatze redone all as one commit by reset

@@ -119,6 +121,11 @@ func (u *User) BeforeUpdate() {
u.UpdatedUnix = time.Now().Unix()
}

// Set time to last login
func (u *User) UpdateLastLogin() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe name this SetLastLogin()? Update is a bit misleading, it would be apropriate if this actually saved the change to the database.

Copy link
Contributor Author

@joubertredrat joubertredrat Nov 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreynering, @0xBAADF00D asked to pu this name, originally was setAfterLogin()

Maybe UpdateLastLogin will be a more appropriate name for this function

I will provide fix for this tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like SetLastLogin()

@andreynering
Copy link
Contributor

It's working fine. Can be merged after update.

@lunny lunny added this to the 1.0.0 milestone Nov 9, 2016
@lunny lunny added type/enhancement An improvement of existing functionality type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Nov 9, 2016
@lunny
Copy link
Member

lunny commented Nov 9, 2016

Yes. It's ready for merge. @0xBAADF00D @DblK Please check and Dismiss review.

@joubertredrat
Copy link
Contributor Author

Recommit with last changes

@andreynering
Copy link
Contributor

andreynering commented Nov 9, 2016

LGTM

1 similar comment
@bkcsoft
Copy link
Member

bkcsoft commented Nov 9, 2016

LGTM

@lunny
Copy link
Member

lunny commented Nov 9, 2016

Could we dismiss or wait for @0xBAADF00D @DblK ?

Copy link
Member

@bkcsoft bkcsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix gofmt lint-errors

@@ -119,6 +121,11 @@ func (u *User) BeforeUpdate() {
u.UpdatedUnix = time.Now().Unix()
}

// Set time to last login
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment has to start with the function-name, e.g // SetLastLogin sets the time of last login. May sound stupid, but go fmt requires it 😒

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkcsoft Okay, I will provide this

func (u *User) SetLastLogin() {
u.LastLoginUnix = time.Now().Unix()
}

func (u *User) AfterSet(colName string, _ xorm.Cell) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, it requires a comment that starts with // AfterSet

Copy link
Contributor Author

@joubertredrat joubertredrat Nov 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkcsoft AfterSet wasn't written by me, then I think that I don't know that this function make. I can take advantage of my commit and put it, but I'll need help to understand this function. Or I can put only // AfterSet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkcsoft can be // AfterSet format data from database for display?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// AfterSet does magic :trollface: (ask @lunny since he knows XORM 🙂 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunny now the ball is with you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @andreynering, comment these should be another PR.

@joubertredrat
Copy link
Contributor Author

@bkcsoft add comments on BeforeInsert, BeforeUpdate, APIFormat, RepoCreationNum, CanCreateRepo, IsFollowing, ShortName, IsUsableUsername, countUsers, updateUser, GetUserByKeyID, getUserByID, IsFollowing too?

@andreynering
Copy link
Contributor

If that function doesn't change in this PR, you don't need to change that.

Someone can send another PR for that.

Em qua, 9 de nov de 2016 às 14:36, Joubert RedRat [email protected]
escreveu:

@bkcsoft https://github.com/bkcsoft add comments on BeforeInsert,
BeforeUpdate, APIFormat, RepoCreationNum, CanCreateRepo, IsFollowing,
ShortName, IsUsableUsername, countUsers, updateUser, GetUserByKeyID,
getUserByID, IsFollowing too?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#121 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGr962U05vISAsWD1F0xYl-7137tn5PQks5q8ewigaJpZM4Ksc3s
.

@lunny
Copy link
Member

lunny commented Nov 10, 2016

@DblK, hi, please review and it's ready for merge.

@DblK DblK added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Nov 10, 2016
@lunny lunny merged commit 1b238fe into go-gitea:master Nov 10, 2016
@joubertredrat
Copy link
Contributor Author

joubertredrat commented Nov 10, 2016

@bkcsoft, @lunny merged before my changes on comments as you requested, don't have problem on this?

This comment has to start with the function-name, e.g // SetLastLogin sets the time of last login. May sound stupid, but go fmt requires it 😒

@strk
Copy link
Member

strk commented Nov 10, 2016

On Thu, Nov 10, 2016 at 02:45:52AM -0800, Joubert RedRat wrote:

@bkcsoft, @lunny merged before my changes on comments as you requested, don't have problem on this?

Please file another PR with further changes (merge rate is still wild :)

@lunny
Copy link
Member

lunny commented Nov 10, 2016

^

@tboerger tboerger removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality labels Nov 12, 2016
@tboerger tboerger added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Nov 29, 2016
lunny pushed a commit to lunny/gitea that referenced this pull request Feb 7, 2019
* Add repo_blob

This adds a new Repository.GetBlob(id) method for use by gitea.

* This is a follow-up for PR go-gitea#121 to implement blob_api including full test coverage

Signed-off-by: Berengar W. Lehr <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support to Last login
10 participants