Clean and clarify

Signed-off-by: Etzelia <etzelia@hotmail.com>
rate-insult
Etzelia 2020-06-11 01:05:33 -05:00
parent e5b978dbf5
commit d09db4ddce
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
1 changed files with 3 additions and 6 deletions

View File

@ -39,26 +39,23 @@ func init() {
var accepted bool var accepted bool
if len(players) > 0 { if len(players) > 0 {
nickname = players[0].Username nickname = players[0].Username
if len(apps) > 0 { if len(apps) == 0 {
accepted = apps[0].Accepted
} else {
apps, err = models.Application(models.NewDjangoBuilder().Exact(django.ApplicationID, fmt.Sprintf("%d", players[0].ApplicationID))) apps, err = models.Application(models.NewDjangoBuilder().Exact(django.ApplicationID, fmt.Sprintf("%d", players[0].ApplicationID)))
if len(apps) == 0 { if len(apps) == 0 {
return errors.New("something hecked up, please contact staff") return errors.New("something hecked up, please contact staff")
} }
accepted = apps[0].Accepted
} }
} else if len(apps) > 0 { } else if len(apps) > 0 {
accepted = apps[0].Accepted
if accepted { if accepted {
return errors.New("please join the server and then re-try this command") return errors.New("please join the server and then re-try this command")
} }
} else { } else {
return errors.New("no player or applications found for that username") return errors.New("no player or applications found for that username")
} }
accepted = apps[0].Accepted
if !accepted { if !accepted {
return errors.New("sorry, your application was denied") return errors.New("sorry, your application was denied or is still in review")
} }
// Accepted // Accepted