mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Fix random things
Add users to adminpanel, cleanup routes, remove byebugs
This commit is contained in:
parent
4d06c80bfe
commit
2627e43e26
5 changed files with 18 additions and 13 deletions
|
@ -9,14 +9,6 @@ class ChallengesController < ApplicationController
|
|||
return_here
|
||||
end
|
||||
|
||||
def refresh
|
||||
Challenge.past.pending.each do |c|
|
||||
c.destroy
|
||||
end
|
||||
|
||||
render text: t(:challenges_cleared)
|
||||
end
|
||||
|
||||
def new
|
||||
#No new challenges for now.
|
||||
raise AccessError
|
||||
|
@ -69,6 +61,16 @@ class ChallengesController < ApplicationController
|
|||
render text: t(:challenges_cleared)
|
||||
end
|
||||
|
||||
# Custom method
|
||||
|
||||
def refresh
|
||||
Challenge.past.pending.each do |c|
|
||||
c.destroy
|
||||
end
|
||||
|
||||
render text: t(:challenges_cleared)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_challenge
|
||||
|
|
|
@ -296,7 +296,6 @@ class User < ActiveRecord::Base
|
|||
# FIXME: if team has been removed
|
||||
def validate_team
|
||||
if team and !active_teams.exists?({:id => team.id})
|
||||
byebug
|
||||
self.team = nil
|
||||
self.save!
|
||||
errors.add :team
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<li><%= link_to "Contests", contests_path %></li>
|
||||
<li><%= link_to "Challenges", challenges_path %></li>
|
||||
<li><%= link_to "Maps", maps_path %></li>
|
||||
<li><%= link_to "Users", users_path %></li>
|
||||
<li><%= link_to "Custom Article URLs", custom_urls_path %></li>
|
||||
</ul>
|
||||
</div>
|
|
@ -60,7 +60,11 @@ Ensl::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
resources :locks
|
||||
resources :contesters
|
||||
resources :contesters do
|
||||
collection do
|
||||
get :recalc
|
||||
end
|
||||
end
|
||||
|
||||
get "contests/:id/confirmedmatches" => "contests#confirmed_matches", as: :confirmed_matches
|
||||
resources :contests
|
||||
|
@ -113,8 +117,6 @@ Ensl::Application.routes.draw do
|
|||
get 'data_files/delFile'
|
||||
get 'data_files/trash'
|
||||
|
||||
get 'contesters/recalc'
|
||||
|
||||
get 'directories', to: "directories#show", id: 1
|
||||
|
||||
get 'gathers/refresh'
|
||||
|
|
|
@ -5,6 +5,7 @@ services:
|
|||
command: "bundle exec puma"
|
||||
tty: true
|
||||
stdin_open: true
|
||||
# NOtE: Use attach rather than this
|
||||
# Debug
|
||||
# command: /bin/bash
|
||||
container_name: ensl_dev
|
||||
|
|
Loading…
Reference in a new issue