mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-23 07:04:27 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user