Skip to content

Commit

Permalink
inject config, never allow global
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Sep 26, 2017
1 parent 6570610 commit dd8dea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion securedrop/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from source_app import create_app

app = create_app()
app = create_app(config)


if __name__ == "__main__": # pragma: no cover
Expand Down
6 changes: 1 addition & 5 deletions securedrop/source_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from os import path
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

import config as global_config
import crypto_util
import i18n
import store
Expand All @@ -21,10 +20,7 @@
from source_app.utils import logged_in


def create_app(config=None):
if config is None:
config = global_config

def create_app(config):
app = Flask(__name__,
template_folder=config.SOURCE_TEMPLATES_DIR,
static_folder=path.join(config.SECUREDROP_ROOT, 'static'))
Expand Down

0 comments on commit dd8dea7

Please sign in to comment.