|
1 |
| -from flask import request, abort, url_for |
| 1 | +import datetime |
| 2 | + |
| 3 | +from flask import abort, request, url_for |
2 | 4 | from flask_restplus import Namespace, Resource
|
3 |
| -from CTFd.models import ( |
4 |
| - db, |
5 |
| - Challenges, |
6 |
| - HintUnlocks, |
7 |
| - Tags, |
8 |
| - Hints, |
9 |
| - Flags, |
10 |
| - Solves, |
11 |
| - Fails, |
12 |
| - ChallengeFiles as ChallengeFilesModel, |
| 5 | +from sqlalchemy.sql import and_ |
| 6 | + |
| 7 | +from CTFd.cache import clear_standings |
| 8 | +from CTFd.models import ChallengeFiles as ChallengeFilesModel |
| 9 | +from CTFd.models import Challenges, Fails, Flags, Hints, HintUnlocks, Solves, Tags, db |
| 10 | +from CTFd.plugins.challenges import CHALLENGE_CLASSES, get_chal_class |
| 11 | +from CTFd.schemas.flags import FlagSchema |
| 12 | +from CTFd.schemas.hints import HintSchema |
| 13 | +from CTFd.schemas.tags import TagSchema |
| 14 | +from CTFd.utils import config, get_config |
| 15 | +from CTFd.utils import user as current_user |
| 16 | +from CTFd.utils.config.visibility import ( |
| 17 | + accounts_visible, |
| 18 | + challenges_visible, |
| 19 | + scores_visible, |
13 | 20 | )
|
14 |
| -from CTFd.plugins.challenges import CHALLENGE_CLASSES |
15 |
| -from CTFd.utils.dates import isoformat |
| 21 | +from CTFd.utils.dates import ctf_ended, ctf_paused, ctftime, isoformat, unix_time_to_utc |
16 | 22 | from CTFd.utils.decorators import (
|
| 23 | + admins_only, |
17 | 24 | during_ctf_time_only,
|
18 | 25 | require_verified_emails,
|
19 |
| - admins_only, |
20 | 26 | )
|
21 | 27 | from CTFd.utils.decorators.visibility import (
|
22 | 28 | check_challenge_visibility,
|
23 | 29 | check_score_visibility,
|
24 | 30 | )
|
25 |
| -from CTFd.cache import clear_standings |
26 |
| -from CTFd.utils.config.visibility import ( |
27 |
| - scores_visible, |
28 |
| - accounts_visible, |
29 |
| - challenges_visible, |
30 |
| -) |
31 |
| -from CTFd.utils.user import is_admin, authed |
32 |
| -from CTFd.utils.modes import get_model, generate_account_url |
33 |
| -from CTFd.schemas.tags import TagSchema |
34 |
| -from CTFd.schemas.hints import HintSchema |
35 |
| -from CTFd.schemas.flags import FlagSchema |
36 |
| -from CTFd.utils import config, get_config |
37 |
| -from CTFd.utils import user as current_user |
38 |
| -from CTFd.utils.user import get_current_team |
39 |
| -from CTFd.utils.user import get_current_user |
40 |
| -from CTFd.plugins.challenges import get_chal_class |
41 |
| -from CTFd.utils.dates import ctf_ended, ctf_paused, ctftime, unix_time_to_utc |
42 | 31 | from CTFd.utils.logging import log
|
| 32 | +from CTFd.utils.modes import generate_account_url, get_model |
43 | 33 | from CTFd.utils.security.signing import serialize
|
44 |
| -from sqlalchemy.sql import and_ |
45 |
| -import datetime |
| 34 | +from CTFd.utils.user import authed, get_current_team, get_current_user, is_admin |
46 | 35 |
|
47 | 36 | challenges_namespace = Namespace(
|
48 | 37 | "challenges", description="Endpoint to retrieve Challenges"
|
|
0 commit comments