mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
fix: fix bug when init plan and pricing and record (#2934)
* fix: fix potential bugs in init data * fix: improve code format * fix: fix bug when init plan and pricing and record
This commit is contained in:
@ -666,7 +666,7 @@ func initDefinedPlan(plan *Plan) {
|
||||
panic(err)
|
||||
}
|
||||
if !affected {
|
||||
panic("Fail to delete enforcer")
|
||||
panic("Fail to delete plan")
|
||||
}
|
||||
}
|
||||
plan.CreatedTime = util.GetCurrentTime()
|
||||
@ -677,7 +677,7 @@ func initDefinedPlan(plan *Plan) {
|
||||
}
|
||||
|
||||
func initDefinedPricing(pricing *Pricing) {
|
||||
existed, err := getPlan(pricing.Owner, pricing.Name)
|
||||
existed, err := getPricing(pricing.Owner, pricing.Name)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -719,6 +719,7 @@ func initDefinedInvitation(invitation *Invitation) {
|
||||
}
|
||||
|
||||
func initDefinedRecord(record *casvisorsdk.Record) {
|
||||
record.Id = 0
|
||||
record.CreatedTime = util.GetCurrentTime()
|
||||
_ = AddRecord(record)
|
||||
}
|
||||
|
Reference in New Issue
Block a user