summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-04-20 02:49:26 +0200
committerMax Magorsch <arzano@gentoo.org>2020-04-20 02:49:26 +0200
commitafbef434b514b90a134f93ed043edd44bf564b64 (patch)
tree483124213a01ae6f101288aaffa0e9877ac98344 /pkg/models
parentMake the domain configurable (diff)
downloadglsamaker-afbef434b514b90a134f93ed043edd44bf564b64.tar.gz
glsamaker-afbef434b514b90a134f93ed043edd44bf564b64.tar.bz2
glsamaker-afbef434b514b90a134f93ed043edd44bf564b64.zip
Correctly display the user name in comments
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'pkg/models')
-rw-r--r--pkg/models/cve/feed.go3
-rw-r--r--pkg/models/glsa.go4
2 files changed, 4 insertions, 3 deletions
diff --git a/pkg/models/cve/feed.go b/pkg/models/cve/feed.go
index 527f233..598c3ab 100644
--- a/pkg/models/cve/feed.go
+++ b/pkg/models/cve/feed.go
@@ -73,7 +73,8 @@ type Comment struct {
Id int64 `pg:",pk,unique"`
GlsaId int64
CVEId string
- User int64
+ UserId int64
+ User *users.User
UserBadge users.Badge
Type string
Message string
diff --git a/pkg/models/glsa.go b/pkg/models/glsa.go
index 9f8c3ec..1a6cddc 100644
--- a/pkg/models/glsa.go
+++ b/pkg/models/glsa.go
@@ -86,7 +86,7 @@ func (glsa *Glsa) ComputeStatus(user *users.User) {
status.WorkflowStatus = "approved"
} else {
for _, comment := range glsa.Comments {
- if comment.User == user.Id {
+ if comment.UserId == user.Id {
status.WorkflowStatus = "commented"
break
}
@@ -99,7 +99,7 @@ func (glsa *Glsa) ComputeStatus(user *users.User) {
func (glsa *Glsa) ComputeCommentBadges() {
for _, comment := range glsa.Comments {
user := new(users.User)
- connection.DB.Model(user).Where("id = ?", comment.User).Select()
+ connection.DB.Model(user).Where("id = ?", comment.UserId).Select()
comment.UserBadge = user.Badge
}