Skip to content

Commit

Permalink
Update ksp.moon
Browse files Browse the repository at this point in the history
  • Loading branch information
TangentFoxy committed Dec 6, 2016
1 parent 7256721 commit 1957c46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ksp.moon
Expand Up @@ -297,13 +297,13 @@ class extends lapis.Application
if @session.id
if user = Users\find id: @session.id
if user.admin
a href: @url_for("ksp_random"), class: "pure-button", "Random"
a href: @url_for("ksp_random"), target: "_blank", class: "pure-button", "Random"

[random: "/random"]: =>
if @session.id
if user = Users\find id: @session.id
if user.admin
crafts = Crafts\select "WHERE status = 1"
crafts = Crafts\select "WHERE status = 1 OR status = 7"
math.randomseed(os.time()) -- this is terrible randomness, figure out how to fix it
rand = math.random(1,#crafts)
return redirect_to: @url_for "ksp_craft", id: crafts[rand].id
Expand Down

0 comments on commit 1957c46

Please sign in to comment.