Skip to content

Commit

Permalink
challenge registration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Nov 23, 2023
1 parent cb72999 commit 805d8fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pwnshop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def register_challenge(challenge):
module = inspect.getmodule(challenge)
module_name = module.__name__
module_name = module.__name__.split(".")[-1]
challenge_name = challenge.__name__

if challenge_name in ALL_CHALLENGES:
Expand All @@ -17,3 +17,7 @@ def register_challenge(challenge):
ALL_CHALLENGES[challenge_name] = challenge
MODULE_LEVELS.setdefault(module_name, []).append(challenge)
ALL_MODULES[module_name] = module

def register_challenges(challenges):
for c in challenges:
register_challenge(c)

0 comments on commit 805d8fd

Please sign in to comment.