mirror of https://github.com/dirtbags/moth.git
Properly anonymize all point log entries
This commit is contained in:
parent
843996f2c4
commit
60d7192e04
|
@ -196,7 +196,7 @@ func (mh *MothRequestHandler) exportStateIfRegistered(override bool) *StateExpor
|
||||||
} else {
|
} else {
|
||||||
exportID := strconv.Itoa(logno)
|
exportID := strconv.Itoa(logno)
|
||||||
name, _ := mh.State.TeamName(awd.TeamID)
|
name, _ := mh.State.TeamName(awd.TeamID)
|
||||||
exportIDs[awd.TeamID] = awd.TeamID
|
exportIDs[awd.TeamID] = exportID
|
||||||
awd.TeamID = exportID
|
awd.TeamID = exportID
|
||||||
export.TeamNames[exportID] = name
|
export.TeamNames[exportID] = name
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,12 @@ func TestServer(t *testing.T) {
|
||||||
if len(es.TeamNames) != 2 {
|
if len(es.TeamNames) != 2 {
|
||||||
t.Error("Anonymous TeamNames is wrong:", es.TeamNames)
|
t.Error("Anonymous TeamNames is wrong:", es.TeamNames)
|
||||||
}
|
}
|
||||||
|
if len(es.PointsLog) != 2 {
|
||||||
|
t.Error("Points log wrong length")
|
||||||
|
}
|
||||||
|
if es.PointsLog[1].TeamID != "0" {
|
||||||
|
t.Error("Second point log didn't anonymize team ID correctly:", es.PointsLog[1])
|
||||||
|
}
|
||||||
|
|
||||||
es = handler.ExportState()
|
es = handler.ExportState()
|
||||||
if len(es.TeamNames) != 1 {
|
if len(es.TeamNames) != 1 {
|
||||||
|
|
Loading…
Reference in New Issue