General fixes and PEP8 enforcement (#258)

* Fixing index page links when you deploy on a subdirectory

* Updating travis for pep8

* autopep8 with just formatting changes
This commit is contained in:
Kevin Chung
2017-05-12 00:34:20 -04:00
committed by GitHub
parent b4d0d1ecab
commit e16d3a0b6e
21 changed files with 152 additions and 147 deletions

View File

@@ -1,10 +1,12 @@
from CTFd.plugins.keys import get_key_class
from CTFd.models import db, Keys
class BaseChallenge(object):
id = None
name = None
class CTFdStandardChallenge(BaseChallenge):
id = 0
name = "standard"
@@ -19,11 +21,12 @@ class CTFdStandardChallenge(BaseChallenge):
CHALLENGE_CLASSES = {
0 : CTFdStandardChallenge
0: CTFdStandardChallenge
}
def get_chal_class(class_id):
cls = CHALLENGE_CLASSES.get(class_id)
if cls is None:
raise KeyError
return cls
return cls

View File

@@ -11,6 +11,7 @@ class BaseKey(object):
def compare(self, saved, provided):
return True
class CTFdStaticKey(BaseKey):
id = 0
name = "static"
@@ -36,8 +37,8 @@ class CTFdRegexKey(BaseKey):
KEY_CLASSES = {
0 : CTFdStaticKey,
1 : CTFdRegexKey
0: CTFdStaticKey,
1: CTFdRegexKey
}
@@ -45,4 +46,4 @@ def get_key_class(class_id):
cls = KEY_CLASSES.get(class_id)
if cls is None:
raise KeyError
return cls
return cls