Report error in register command (#14)
Formatting Signed-off-by: Etzelia <etzelia@hotmail.com> Revise Signed-off-by: Etzelia <etzelia@hotmail.com> Fix register and update Drone Signed-off-by: Etzelia <etzelia@hotmail.com> Reviewed-on: https://git.etztech.xyz/Etzelia/sedbot/pulls/14fix-app
parent
944e417ddb
commit
e688ba4733
32
.drone.yml
32
.drone.yml
|
@ -15,4 +15,34 @@ steps:
|
|||
pull: always
|
||||
image: golang:1.15
|
||||
commands:
|
||||
- make vet
|
||||
- make vet
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: release
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
steps:
|
||||
- name: build
|
||||
pull: always
|
||||
image: golang:1.15
|
||||
commands:
|
||||
- make build-all
|
||||
- name: gitea-release
|
||||
pull: always
|
||||
image: plugins/gitea-release:1
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
base_url: https://git.etztech.xyz
|
||||
files:
|
||||
- "sedbot"
|
||||
- name: gitea-prune
|
||||
pull: always
|
||||
image: jolheiser/dgrp:latest
|
||||
settings:
|
||||
base: https://git.etztech.xyz
|
||||
token:
|
||||
from_secret: gitea_token
|
||||
keep: 2
|
|
@ -44,7 +44,6 @@ func init() {
|
|||
}
|
||||
|
||||
var nickname string
|
||||
var accepted *bool
|
||||
if len(players) > 0 {
|
||||
player := players[0]
|
||||
|
||||
|
@ -60,9 +59,12 @@ func init() {
|
|||
nickname = player.Username
|
||||
if len(apps) == 0 {
|
||||
apps, err = models.Application(models.NewDjangoBuilder().Eq(django.ApplicationID, player.ApplicationID))
|
||||
if len(apps) == 0 {
|
||||
if err != nil {
|
||||
return "Something went wrong, please contact staff", nil
|
||||
}
|
||||
if len(apps) == 0 {
|
||||
return "No application found for that player", nil
|
||||
}
|
||||
}
|
||||
} else if len(apps) > 0 {
|
||||
if apps[0].Accepted != nil && *apps[0].Accepted {
|
||||
|
@ -71,7 +73,7 @@ func init() {
|
|||
} else {
|
||||
return "No player or applications found for that username", nil
|
||||
}
|
||||
accepted = apps[0].Accepted
|
||||
accepted := apps[0].Accepted
|
||||
|
||||
if accepted == nil {
|
||||
return "Your application is still being reviewed, hang tight", nil
|
||||
|
|
Loading…
Reference in New Issue