diff --git a/.gitignore b/.gitignore index 872c30d04..cc21c8fc7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build .webpack_build_cache/ *.manifest.json node_modules/ -static/gen/ +dist/ +tracker/static/gen/ yarn-error.log TEST*.xml diff --git a/.prettierignore b/.prettierignore index 4047166e5..66be8e321 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,2 @@ node_modules/ -static/ +tracker/static/ diff --git a/README.md b/README.md index ec31341ff..de97a322a 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,122 @@ -See setup instructions in the top level repository: https://github.com/GamesDoneQuick/donation-tracker-toplevel +# Django Donation Tracker -## Contributing +## Requirements -### `pre-commit` +- Python 3.6, 3.7 (3.8 is untested) -This project uses [`pre-commit`](https://pre-commit.com/) to run linters and other checks before every commit. +Additionally, if you are planning on developing, and/or building the JS bundles yourself: + +- Node 12.x +- `yarn` (`npm i -g yarn`) +- `pre-commit` (`pip install pre-commit`) + +If you need to isolate your development environment, some combination of `direnv`, `pyenv`, `nvm`, and/or `asdf` will be +very helpful. + +## Deploying + +This app shouldn't require any special treatment to deploy. You should be able to install it with pip, either from PyPI +(preferred so that you don't have to build the JS bundles yourself), GitHub, or locally. + +For further reading on what else your server needs to look like: + +- [Deploying Django](https://docs.djangoproject.com/en/2.2/howto/deployment/) +- [Deploying Django Channels](https://channels.readthedocs.io/en/latest/deploying.html) + +Docker should also work but support is still in the experimental phases. + +## Development Quick Start -`pre-commit` has been added as part of `requirements.txt`, so new installs should automatically get it, but if not, you can get it manually with pip, and then install the hooks with the `pre-commit` binary. +Start up a new Django Project like the [Django Tutorial](https://docs.djangoproject.com/en/2.2/intro/tutorial01/). + +- `pip install django~=2.2` +- `django-admin startproject tracker_development` +- `cd tracker_development` + +Clone the Git repo and install it in edit mode: + +- `git clone git@github.com:GamesDoneQuick/donation-tracker` +- `pip install -e donation-tracker` + +Install remaining development dependencies: + +- `cd donation-tracker` +- `yarn` +- `pre-commit install` +- `pre-commit install --hook-type pre-push` + +Add the following apps to the `INSTALLED_APPS` section of `tracker_development/settings.py`: ``` -pip install pre-commit -pre-commit install -pre-commit install --hook-type pre-push + 'channels', + 'post_office', + 'paypal.standard.ipn', + 'tracker', + 'timezone_field', + 'ajax_select', + 'mptt', ``` -And now every time you `git commit` or `git push`, the appropriate checks will run! +Add the following chunk somewhere in `settings.py`: -_Note:_ You _can_ bypass these checks by adding `--no-verify` when you commit or push, though this is highly discouraged in most cases. In the future, CI tests may fail if any of these checks are not satisfied. +```python +from tracker import ajax_lookup_channels +AJAX_LOOKUP_CHANNELS = ajax_lookup_channels.AJAX_LOOKUP_CHANNELS +ASGI_APPLICATION = 'tracker_development.routing.application' +CHANNEL_LAYERS = {'default': {'BACKEND': 'channels.layers.InMemoryChannelLayer'}} +``` + +Create a file next called `routing.py` next to `settings.py` and put the following in it: -If the pre-commit hooks fail on your first commit with them, make sure you are not inside of a submodule! This can affect where `pre-commit` tries to install hooks, and cloning the tools (specifically, `black`) can cause an error. +```python +from channels.auth import AuthMiddlewareStack +from channels.routing import ProtocolTypeRouter, URLRouter +from channels.security.websocket import AllowedHostsOriginValidator +from django.urls import path -To avoid this, clone this repo separately to a new folder (not as a submodule), run `pre-commit install`, and make a fake commit to get the environment tools installed. These tools are globalized, so going back and committing from the submodule copy should now work! +import tracker.routing + +application = ProtocolTypeRouter({ + 'websocket': AllowedHostsOriginValidator( + AuthMiddlewareStack( + URLRouter( + [path('tracker/', URLRouter(tracker.routing.websocket_urlpatterns))] + ) + ) + ), +}) +``` + +Edit the `tracker_development/urls.py` file to look something like this: + +```python +from django.contrib import admin +from django.urls import path, include + +import tracker.urls +import ajax_select.urls + +urlpatterns = [ + path('admin/', admin.site.urls), + path('admin/lookups/', include(ajax_select.urls)), + path('tracker/', include(tracker.urls, namespace='tracker')), +] +``` + +In the main project folder: + +- `python manage.py runserver` + +In a separate shell, in the `donation-tracker` folder: + +- `yarn start` + +If everything boots up correctly, you should be able to visit the [Index Page](http://localhost:8080/tracker). Additionally, you should be able to open the [Websocket Test Page](http://localhost:8080/tracker/websocket_test/) and see the heartbeat. If the page loads but the pings don't work, Channels isn't set up correctly. The [Channels Documentation](https://channels.readthedocs.io/en/latest/installation.html) may be helpful. + +## Contributing + +This project uses [`pre-commit`](https://pre-commit.com/) to run linters and other checks before every commit. + +If you followed the instructions above, `pre-commit` should run the appropriate hooks every time you commit or push. + +_Note:_ You _can_ bypass these checks by adding `--no-verify` when you commit or push, though this is highly discouraged in most cases. In the future, CI tests may fail if any of these checks are not satisfied. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0e24170c6..1988fd4cb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,74 +15,35 @@ jobs: Python37: PYTHON_VERSION: '3.7' - variables: - TOPLEVEL_REVISION: e170b3970c805b4b0c9cb9167c57c78d62f27dd5 - steps: - task: UsePythonVersion@0 inputs: versionSpec: '$(PYTHON_VERSION)' architecture: 'x64' - - script: | - mv -v $(Build.SourcesDirectory) $(Agent.BuildDirectory)/tracker - git clone git://github.com/GamesDoneQuick/donation-tracker-toplevel $(Build.SourcesDirectory) - cd $(Build.SourcesDirectory) - git reset --hard $(TOPLEVEL_REVISION) - mv -v $(Agent.BuildDirectory)/tracker $(Build.SourcesDirectory) - cp -v tracker/ci/.env.ci $(Build.SourcesDirectory)/.env - displayName: 'Install toplevel around the tracker' - - - task: PythonScript@0 - displayName: 'Export project path' - inputs: - scriptSource: 'inline' - script: | - """Search all subdirectories for `manage.py`.""" - from glob import iglob - from os import path - manage_py = next(iglob(path.join('**', 'manage.py'), recursive=True), None) - if not manage_py: - raise SystemExit('Could not find a Django project') - project_location = path.dirname(path.abspath(manage_py)) - print('Found Django project in', project_location) - print('##vso[task.setvariable variable=projectRoot]{}'.format(project_location)) - - task: CacheBeta@1 inputs: - key: pip | $(Agent.OS) | tracker/requirements.txt + key: pip | $(Agent.OS) | requirements.txt | setup.py path: $(Pipeline.Workspace)/../../.cache/pip displayName: 'Cache pip' - - script: | - python -m pip install --upgrade pip setuptools wheel - pip install -r requirements.txt - pip install -r tracker/tests/requirements.txt - displayName: 'Install python prerequisites' - - task: CacheBeta@1 inputs: - key: yarn | $(Agent.OS) | tracker/yarn.lock - path: $(Build.SourcesDirectory)/tracker/node_modules + key: yarn | $(Agent.OS) | production | yarn.lock + path: $(Build.SourcesDirectory)/node_modules displayName: 'Cache yarn' - script: | - cd tracker - yarn install --frozen-lockfile - displayName: 'Install node prerequisites' + python -m pip install --upgrade pip setuptools wheel + pip install -e . + pip install -r tests/requirements.txt + displayName: 'Install python prerequisites' - script: | - cd tracker python check_migrations.py displayName: 'Check for bad or missing migrations' - script: | - cd tracker - yarn build - displayName: 'Generate webpack manifest' - - - script: | - cd tracker python runtests.py --parallel --no-input displayName: 'Run Django tests' @@ -92,6 +53,26 @@ jobs: testRunTitle: 'Python $(PYTHON_VERSION)' condition: succeededOrFailed() + - job: build_package + displayName: Tracker Package + steps: + - task: CacheBeta@1 + inputs: + key: pip | $(Agent.OS) | requirements.txt | setup.py + path: $(Pipeline.Workspace)/../../.cache/pip + displayName: 'Cache pip' + + - task: CacheBeta@1 + inputs: + key: yarn | $(Agent.OS) | production | yarn.lock + path: $(Build.SourcesDirectory)/node_modules + displayName: 'Cache yarn' + + - script: | + python -m pip install --upgrade pip setuptools wheel + python setup.py package + displayName: 'Build Package' + - job: tracker_frontend_tests dependsOn: [] displayName: Tracker Frontend @@ -102,7 +83,7 @@ jobs: steps: - task: Cache@2 inputs: - key: yarn | $(Agent.OS) | yarn.lock + key: yarn | $(Agent.OS) | development | yarn.lock path: $(YARN_CACHE_FOLDER) displayName: 'Cache yarn' diff --git a/ci/.env.ci b/ci/.env.ci deleted file mode 100644 index 1acfd6f21..000000000 --- a/ci/.env.ci +++ /dev/null @@ -1,13 +0,0 @@ -ALLOWED_HOSTS=localhost -DEBUG=True -PAYPAL_TEST=True -TIME_ZONE=America/New_York -SECRET_KEY=TestTheSecretIDareYou -STATIC_URL='/static/' -STATIC_ROOT='/var/www/static/' -HAS_GDOC=False -HAS_EMAIL=False -HAS_GOOGLE_APP_ID=False -HAS_GIANTBOMB_API_KEY=False -HAS_FILE_STORAGE=False -HAS_AWS_FILE_STORAGE=False diff --git a/commandutil.py b/commandutil.py deleted file mode 100644 index d5a2faa8e..000000000 --- a/commandutil.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.core.management.base import BaseCommand - - -class TrackerCommand(BaseCommand): - requires_system_checks = False - - def __init__(self): - self.verbosity = 0 - - def message(self, message, verbosity_level=1): - if self.verbosity >= verbosity_level: - if isinstance(message, str): - message = message.encode('utf-8') - print(message) - - def handle(self, *args, **options): - if 'verbosity' in options: - self.verbosity = options['verbosity'] - else: - self.verbosity = 1 - self.message('Positional arguments: {0}'.format(args), 3) - self.message('Named arguments: {0}'.format(options), 3) diff --git a/context_processors.py b/context_processors.py deleted file mode 100644 index 7d78f8237..000000000 --- a/context_processors.py +++ /dev/null @@ -1,10 +0,0 @@ -# http://stackoverflow.com/questions/4557114/django-custom-template-tag-which-accepts-a-boolean-parameter - -# It came up that I needed true/false values in the templates, 0/1 works, but I like having symbolic names - - -def booleans(request): - return { - 'True': True, - 'False': False, - } diff --git a/package.json b/package.json index 9dbdf1c21..b735b5e3a 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "description": "GDQ Donation Tracker", "scripts": { - "build": "git clean -fxd static && cross-env NODE_ENV=production webpack", - "start": "cross-env NODE_ENV=${NODE_ENV:-development} SOURCE_MAPS=${SOURCE_MAPS:-1} webpack-dev-server", + "build": "NODE_ENV=${NODE_ENV:-production} webpack", + "start": "NODE_ENV=${NODE_ENV:-development} SOURCE_MAPS=${SOURCE_MAPS:-1} webpack-dev-server", "test": "karma start --single-run", "test:watch": "karma start", "fix:prettier": "prettier --write \"bundles/**\" --write \"spec/**\"", @@ -18,9 +18,7 @@ }, "author": "", "license": "ISC", - "dependencies": {}, - "devDependencies": { - "@babel/cli": "^7.6.4", + "dependencies": { "@babel/core": "^7.5.5", "@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-proposal-optional-chaining": "^7.6.0", @@ -34,6 +32,53 @@ "@fortawesome/free-regular-svg-icons": "^5.11.2", "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.7", + "autoprefixer": "^9.7.0", + "babel-loader": "^8.0.6", + "babel-plugin-lodash": "^3.3.4", + "babel-plugin-react-remove-properties": "^0.3.0", + "classnames": "^2.2.6", + "classnames-loader": "^2.1.0", + "connected-react-router": "^6.5.2", + "core-js": "3.3.3", + "css-loader": "^3.2.0", + "cssnano": "^4.1.10", + "file-loader": "^4.2.0", + "history": "^4.10.1", + "keymirror": "^0.1.1", + "lodash": "^4.17.15", + "luxon": "^1.21.3", + "mini-css-extract-plugin": "^0.8.0", + "moment": "^2.24.0", + "moment-timezone": "^0.5.25", + "postcss-loader": "^3.0.0", + "postcss-nesting": "^7.0.1", + "postcss-preset-env": "^6.7.0", + "prop-types": "^15.7.2", + "query-string": "^6.8.3", + "re-reselect": "^3.4.0", + "react": "^16.10.2", + "react-dnd": "^9.4.0", + "react-dnd-html5-backend": "^9.4.0", + "react-dnd-test-backend": "^9.4.0", + "react-dom": "^16.10.2", + "react-markdown": "^4.2.2", + "react-numeric": "^1.0.0", + "react-redux": "^7.1.1", + "react-router": "^5.1.2", + "react-router-dom": "^5.1.2", + "redux": "^4.0.4", + "redux-devtools-extension": "^2.13.8", + "redux-thunk": "^2.3.0", + "reselect": "^4.0.0", + "terser-webpack-plugin": "^2.2.1", + "url-loader": "^2.2.0", + "validator": "^12.0.0", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.9", + "webpack-yam-plugin": "^1.0.1" + }, + "devDependencies": { + "@babel/cli": "^7.6.4", "@gamesdonequick/prettier-config": "^2.2.0", "@hot-loader/react-dom": "^16.10.2", "@storybook/addon-actions": "^5.1.3", @@ -66,69 +111,24 @@ "@types/validator": "^10.11.3", "@typescript-eslint/eslint-plugin": "^2.6.1", "@typescript-eslint/parser": "^2.6.1", - "autoprefixer": "^9.7.0", "babel-eslint": "^10.0.3", - "babel-loader": "^8.0.6", - "babel-plugin-lodash": "^3.3.4", - "babel-plugin-react-remove-properties": "^0.3.0", - "classnames": "^2.2.6", - "classnames-loader": "^2.1.0", - "connected-react-router": "^6.5.2", - "core-js": "3.3.3", - "cross-env": "^6.0.3", - "css-loader": "^3.2.0", - "cssnano": "^4.1.10", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2", "eslint": "^6.5.1", "eslint-plugin-react": "^7.16.0", "eslint-plugin-react-hooks": "^4.0.8", "fetch-mock": "^8.0.0-alpha.14", - "file-loader": "^4.2.0", - "history": "^4.10.1", "jasmine-core": "^3.5.0", "karma": "^4.4.1", "karma-chrome-launcher": "^3.1.0", "karma-jasmine": "^2.0.1", "karma-webpack": "^4.0.2", - "keymirror": "^0.1.1", - "lodash": "^4.17.15", - "luxon": "^1.21.3", - "mini-css-extract-plugin": "^0.8.0", - "moment": "^2.24.0", - "moment-timezone": "^0.5.25", - "postcss-loader": "^3.0.0", - "postcss-nesting": "^7.0.1", - "postcss-preset-env": "^6.7.0", "prettier": "^1.18.2", - "prop-types": "^15.7.2", "puppeteer": "^2.0.0", - "query-string": "^6.8.3", - "re-reselect": "^3.4.0", - "react": "^16.10.2", - "react-dnd": "^9.4.0", - "react-dnd-html5-backend": "^9.4.0", - "react-dnd-test-backend": "^9.4.0", - "react-dom": "^16.10.2", "react-hot-loader": "^4.12.15", - "react-markdown": "^4.2.2", - "react-numeric": "^1.0.0", - "react-redux": "^7.1.1", - "react-router": "^5.1.2", - "react-router-dom": "^5.1.2", - "redux": "^4.0.4", - "redux-devtools-extension": "^2.13.8", "redux-mock-store": "^1.5.3", - "redux-thunk": "^2.3.0", - "reselect": "^4.0.0", - "terser-webpack-plugin": "^2.2.1", "typescript": "^3.6.4", - "url-loader": "^2.2.0", - "validator": "^12.0.0", - "webpack": "^4.41.2", - "webpack-cli": "^3.3.9", - "webpack-dev-server": "^3.9.0", - "webpack-yam-plugin": "^1.0.1" + "webpack-dev-server": "^3.9.0" }, "resolve": { "@types/react": "^16.9.11" diff --git a/runtests.py b/runtests.py index b415a9494..1b0e5ca52 100644 --- a/runtests.py +++ b/runtests.py @@ -1,11 +1,12 @@ #!/usr/bin/env python import os import sys +from argparse import ArgumentParser +from subprocess import check_call import django from django.conf import settings from django.test.utils import get_runner -from argparse import ArgumentParser # needs additional dependencies # pip install -r tests/requirements.txt @@ -39,6 +40,9 @@ default=False, help='Tells Django to stop running the test suite after first failed test.', ) + # TODO: the fetches for the ui endpoints blow up if the manifest doesn't exist so we have to build the webpack bundles first + check_call(['yarn', '--frozen-lockfile', '--production']) + check_call(['yarn', 'build']) TestRunner = get_runner(settings, 'xmlrunner.extra.djangotestrunner.XMLTestRunner') TestRunner.add_arguments(parser) test_runner = TestRunner(**parser.parse_args(sys.argv[1:]).__dict__) diff --git a/setup.py b/setup.py index d8e733e77..02b1486a2 100755 --- a/setup.py +++ b/setup.py @@ -1,42 +1,84 @@ # -*- coding: utf-8 -*- -from setuptools import setup +import os + +from setuptools import setup, find_packages, Command + +import subprocess + + +class PackageCommand(Command): + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + subprocess.check_call(['git', 'clean', '-fxd', 'tracker']) + subprocess.check_call(['yarn', '--production']) + subprocess.check_call(['yarn', 'build']) + self.run_command('sdist') + self.run_command('bdist_wheel') + + +package_data = [] + +old_dir = os.getcwd() + +os.chdir('tracker') + +for path in ['templates', 'static', 'locale', 'fixtures']: + for root, dirs, files in os.walk(path): + for f in files: + package_data.append(os.path.join(root, f)) + +os.chdir(old_dir) setup( - name='django-sda_donation_tracker', - version='2.1', + name='django-donation-tracker', + version='3.0', author='Games Done Quick', author_email='tracker@gamesdonequick.com', - packages=['sda_donation_tracker'], - url='https://github.com/uraniumanchor/sda-donation-tracker-2', - license='GPLv2', + packages=find_packages(include=['tracker', 'tracker.*']), + url='https://github.com/GamesDoneQuick/donation-tracker', + license='Apache2', description='A Django app to assist in tracking donations for live broadcast events.', - long_description=open('README.rst').read(), + long_description=open('README.md').read(), zip_safe=False, - include_package_data=True, - package_data={'': ['README.rst']}, + package_data={ + '': ['README.md'], + 'tracker': package_data + ['ui-tracker.manifest.json',], + }, + cmdclass={'package': PackageCommand,}, install_requires=[ - 'chromium-compact-language-detector', - 'Django>=1.8', - 'django-post-office', - 'django-ajax-selects', - 'django-mptt', - 'psycopg2', - 'python-dateutil', - 'pytz', + 'channels~=2.4.0', + 'Django~=2.2', + 'django-ajax-selects==1.9.*', + 'django-betterforms==1.1.*', + 'django-ical==1.7.*', + 'django-mptt==0.10.0', + 'django-paypal==1.0.0', + 'django-post-office==3.2.*', + 'django-timezone-field==3.1', + 'djangorestframework==3.9.*', + 'python-dateutil>=2.8.1', + 'pytz>=2019.3', + 'webpack-manifest~=2.1.1', ], + python_requires='>=3.6, <3.8', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Other Audience', - 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', + 'License :: OSI Approved :: Apache Software License 2.0 (Apache-2.0)', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries :: Python Modules', ], diff --git a/randgen.py b/tests/randgen.py similarity index 99% rename from randgen.py rename to tests/randgen.py index d1b2aab69..0014497dc 100644 --- a/randgen.py +++ b/tests/randgen.py @@ -1,11 +1,10 @@ +import binascii import datetime import decimal import os from decimal import Decimal -import binascii import pytz - from tracker.models import ( Bid, Donation, diff --git a/tests/test_admin.py b/tests/test_admin.py index 0449173a6..7e148a786 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -4,8 +4,9 @@ from django.contrib.auth.models import Permission from django.test import TestCase from django.urls import reverse +from tracker import models -from tracker import randgen, models +from . import randgen User = get_user_model() diff --git a/tests/test_api.py b/tests/test_api.py index 1b779bd8c..cccd0bb05 100755 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,6 +1,8 @@ import json import pytz +import tracker.models as models +import tracker.views.api from django.contrib.admin.models import ( LogEntry, ADDITION as LogEntryADDITION, @@ -12,11 +14,9 @@ from django.core.serializers.json import DjangoJSONEncoder from django.test import override_settings from django.urls import reverse - -import tracker.models as models -import tracker.randgen as randgen -import tracker.views.api from tracker.serializers import TrackerSerializer + +from . import randgen from .util import today_noon, tomorrow_noon, APITestCase diff --git a/tests/test_auth.py b/tests/test_auth.py index bcd53395c..7fa527768 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -9,7 +9,8 @@ from django.utils.http import urlsafe_base64_encode import tracker.auth -import tracker.tests.util as test_util + +from . import util AuthUser = get_user_model() @@ -31,7 +32,7 @@ def test_registration_flow(self): sent_mail = tracker.auth.send_registration_mail( request, new_user, template=TEST_AUTH_MAIL_TEMPLATE ) - contents = test_util.parse_test_mail(sent_mail) + contents = util.parse_test_mail(sent_mail) self.assertEqual(new_user.username, contents['user'][0]) parsed = urllib.parse.urlparse(contents['url'][0]) resp = self.client.get(parsed.path) diff --git a/tests/test_bid.py b/tests/test_bid.py index 39511bdd2..4bbcdf251 100644 --- a/tests/test_bid.py +++ b/tests/test_bid.py @@ -5,8 +5,9 @@ from django.test import TestCase from django.urls import reverse -from tracker import models, randgen +from tracker import models from .util import today_noon +from . import randgen class TestBidBase(TestCase): diff --git a/tests/test_donor.py b/tests/test_donor.py index 4b7bf1798..2224ed10c 100644 --- a/tests/test_donor.py +++ b/tests/test_donor.py @@ -6,8 +6,9 @@ from django.contrib.auth.models import User from django.test import TestCase from django.urls import reverse +from tracker import models, viewutil -from tracker import models, randgen, viewutil +from . import randgen from .util import today_noon, tomorrow_noon diff --git a/tests/test_event.py b/tests/test_event.py index 78e86e8c6..9ebd3ef6d 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -12,7 +12,7 @@ from tracker import models from .util import today_noon, tomorrow_noon, long_ago_noon -from .. import randgen +from . import randgen class TestEvent(TestCase): diff --git a/tests/test_prize.py b/tests/test_prize.py index dbd6a1c56..c35608d27 100644 --- a/tests/test_prize.py +++ b/tests/test_prize.py @@ -11,8 +11,9 @@ from django.test import TestCase from django.test import TransactionTestCase from django.urls import reverse +from tracker import models, prizeutil -from tracker import models, prizeutil, randgen +from . import randgen from .util import today_noon, MigrationsTestCase @@ -977,8 +978,8 @@ def test_accept_deadline_offset(self): class TestBackfillPrevNextMigrations(MigrationsTestCase): - migrate_from = '0001_squashed_0020_add_runner_pronouns_and_platform' - migrate_to = '0003_populate_prev_next_run' + migrate_from = [('tracker', '0001_squashed_0020_add_runner_pronouns_and_platform')] + migrate_to = [('tracker', '0003_populate_prev_next_run')] def setUpBeforeMigration(self, apps): Prize = apps.get_model('tracker', 'Prize') diff --git a/tests/test_prizemail.py b/tests/test_prizemail.py index 73bfd0f34..77272aa4d 100644 --- a/tests/test_prizemail.py +++ b/tests/test_prizemail.py @@ -1,15 +1,14 @@ -import tracker.tests.util as test_util import random - -from django.test import TransactionTestCase -from django.contrib.auth import get_user_model +from functools import reduce import post_office.models - import tracker.models as models -import tracker.randgen as randgen import tracker.prizemail as prizemail -from functools import reduce +from django.contrib.auth import get_user_model +from django.test import TransactionTestCase + +from . import randgen +from . import util AuthUser = get_user_model() @@ -42,7 +41,7 @@ def setUp(self): ) def _parse_mail(self, mail): - contents = test_util.parse_test_mail(mail) + contents = util.parse_test_mail(mail) event = int(contents['event'][0]) winner = int(contents['winner'][0]) contact_name = contents['winner_contact_name'][0] @@ -132,7 +131,7 @@ def setUp(self): ) def _parseMail(self, mail): - contents = test_util.parse_test_mail(mail) + contents = util.parse_test_mail(mail) event = int(contents['event'][0]) handlerId = int(contents['handlerid'][0]) accepted = [int(x) for x in contents.get('accepted', [])] @@ -237,7 +236,7 @@ def setUp(self): self.sender = 'nobody@nowhere.com' def _parseMail(self, mail): - contents = test_util.parse_test_mail(mail) + contents = util.parse_test_mail(mail) event = int(contents['event'][0]) handlerId = int(contents['handlerid'][0]) prizeWins = [int(x) for x in contents.get('prizewinner', [])] @@ -343,7 +342,7 @@ def setUp(self): self.sender = 'nobody@nowhere.com' def _parseMail(self, mail): - contents = test_util.parse_test_mail(mail) + contents = util.parse_test_mail(mail) event = int(contents['event'][0]) winnerId = int(contents['winner'][0]) prizeWins = [int(x) for x in contents.get('prizewinner', [])] diff --git a/tests/test_search_filters.py b/tests/test_search_filters.py index 9e417b24e..cb2756240 100644 --- a/tests/test_search_filters.py +++ b/tests/test_search_filters.py @@ -5,10 +5,11 @@ from django.core.exceptions import PermissionDenied from django.db.models import Q from django.test import TransactionTestCase - -from tracker import models, randgen +from tracker import models from tracker.search_feeds import apply_feed_filter from tracker.search_filters import run_model_query + +from . import randgen from .util import today_noon, long_ago_noon diff --git a/tests/test_settings.py b/tests/test_settings.py index 0676dc518..6e244ea9c 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -11,6 +11,7 @@ 'django.contrib.messages', 'django.contrib.admin', 'django.contrib.staticfiles', + 'channels', 'post_office', 'paypal.standard.ipn', 'tracker', diff --git a/tests/test_viewutil.py b/tests/test_viewutil.py index e07eb0f1f..2e865d837 100644 --- a/tests/test_viewutil.py +++ b/tests/test_viewutil.py @@ -2,10 +2,10 @@ from django.contrib.auth.models import User from django.test import TransactionTestCase +from tracker import models +from tracker.views import parse_value from .util import today_noon -from tracker import models -from ..views import parse_value class TestParseValue(TransactionTestCase): diff --git a/tests/util.py b/tests/util.py index 8ebaccc7e..672eb4cc1 100644 --- a/tests/util.py +++ b/tests/util.py @@ -3,14 +3,12 @@ import random import pytz -from django.apps import apps from django.conf import settings from django.contrib.auth.models import AnonymousUser, User, Permission from django.core.serializers.json import DjangoJSONEncoder from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.test import TransactionTestCase, RequestFactory - from tracker import models @@ -46,12 +44,11 @@ def parse_test_mail(mail): class MigrationsTestCase(TransactionTestCase): - @property - def app(self): - return apps.get_containing_app_config(type(self).__module__).name - - migrate_from = None - migrate_to = None + # e.g + # migrate_from = [('tracker', '0004_add_thing')] + # migrate_to = [('tracker', '0005_backfill_thing')] + migrate_from = [] + migrate_to = [] def setUp(self): assert ( @@ -59,8 +56,6 @@ def setUp(self): ), "TestCase '{}' must define migrate_from and migrate_to properties".format( type(self).__name__ ) - self.migrate_from = [(self.app, self.migrate_from)] - self.migrate_to = [(self.app, self.migrate_to)] executor = MigrationExecutor(connection) old_apps = executor.loader.project_state(self.migrate_from).apps @@ -79,7 +74,7 @@ def setUp(self): def tearDown(self): executor = MigrationExecutor(connection) executor.loader.build_graph() - executor.migrate(executor.loader.graph.leaf_nodes(self.app)) + executor.migrate(executor.loader.graph.leaf_nodes()) def setUpBeforeMigration(self, apps): pass diff --git a/api/__init__.py b/tracker/__init__.py similarity index 100% rename from api/__init__.py rename to tracker/__init__.py diff --git a/admin/__init__.py b/tracker/admin/__init__.py similarity index 100% rename from admin/__init__.py rename to tracker/admin/__init__.py diff --git a/admin/bid.py b/tracker/admin/bid.py similarity index 100% rename from admin/bid.py rename to tracker/admin/bid.py diff --git a/admin/country.py b/tracker/admin/country.py similarity index 100% rename from admin/country.py rename to tracker/admin/country.py diff --git a/admin/donation.py b/tracker/admin/donation.py similarity index 100% rename from admin/donation.py rename to tracker/admin/donation.py diff --git a/admin/event.py b/tracker/admin/event.py similarity index 100% rename from admin/event.py rename to tracker/admin/event.py diff --git a/admin/filters.py b/tracker/admin/filters.py similarity index 100% rename from admin/filters.py rename to tracker/admin/filters.py diff --git a/admin/forms.py b/tracker/admin/forms.py similarity index 100% rename from admin/forms.py rename to tracker/admin/forms.py diff --git a/admin/inlines.py b/tracker/admin/inlines.py similarity index 100% rename from admin/inlines.py rename to tracker/admin/inlines.py diff --git a/admin/log.py b/tracker/admin/log.py similarity index 100% rename from admin/log.py rename to tracker/admin/log.py diff --git a/admin/prize.py b/tracker/admin/prize.py similarity index 100% rename from admin/prize.py rename to tracker/admin/prize.py diff --git a/admin/util.py b/tracker/admin/util.py similarity index 100% rename from admin/util.py rename to tracker/admin/util.py diff --git a/ajax_lookup_channels.py b/tracker/ajax_lookup_channels.py similarity index 100% rename from ajax_lookup_channels.py rename to tracker/ajax_lookup_channels.py diff --git a/feeds/__init__.py b/tracker/api/__init__.py similarity index 100% rename from feeds/__init__.py rename to tracker/api/__init__.py diff --git a/api/serializers.py b/tracker/api/serializers.py similarity index 100% rename from api/serializers.py rename to tracker/api/serializers.py diff --git a/api/urls.py b/tracker/api/urls.py similarity index 100% rename from api/urls.py rename to tracker/api/urls.py diff --git a/api/views.py b/tracker/api/views.py similarity index 100% rename from api/views.py rename to tracker/api/views.py diff --git a/api_urls.py b/tracker/api_urls.py similarity index 100% rename from api_urls.py rename to tracker/api_urls.py diff --git a/auth.py b/tracker/auth.py similarity index 100% rename from auth.py rename to tracker/auth.py diff --git a/consumers/__init__.py b/tracker/consumers/__init__.py similarity index 100% rename from consumers/__init__.py rename to tracker/consumers/__init__.py diff --git a/consumers/ping.py b/tracker/consumers/ping.py similarity index 100% rename from consumers/ping.py rename to tracker/consumers/ping.py diff --git a/decorators.py b/tracker/decorators.py similarity index 100% rename from decorators.py rename to tracker/decorators.py diff --git a/eventutil.py b/tracker/eventutil.py similarity index 100% rename from eventutil.py rename to tracker/eventutil.py diff --git a/management/__init__.py b/tracker/feeds/__init__.py similarity index 100% rename from management/__init__.py rename to tracker/feeds/__init__.py diff --git a/feeds/runs_calendar.py b/tracker/feeds/runs_calendar.py similarity index 100% rename from feeds/runs_calendar.py rename to tracker/feeds/runs_calendar.py diff --git a/fixtures/countries.json b/tracker/fixtures/countries.json similarity index 100% rename from fixtures/countries.json rename to tracker/fixtures/countries.json diff --git a/forms.py b/tracker/forms.py old mode 100755 new mode 100644 similarity index 100% rename from forms.py rename to tracker/forms.py diff --git a/locale/de/LC_MESSAGES/django.po b/tracker/locale/de/LC_MESSAGES/django.po similarity index 100% rename from locale/de/LC_MESSAGES/django.po rename to tracker/locale/de/LC_MESSAGES/django.po diff --git a/locale/en/LC_MESSAGES/django.po b/tracker/locale/en/LC_MESSAGES/django.po old mode 100755 new mode 100644 similarity index 100% rename from locale/en/LC_MESSAGES/django.po rename to tracker/locale/en/LC_MESSAGES/django.po diff --git a/locale/ja/LC_MESSAGES/django.po b/tracker/locale/ja/LC_MESSAGES/django.po similarity index 100% rename from locale/ja/LC_MESSAGES/django.po rename to tracker/locale/ja/LC_MESSAGES/django.po diff --git a/locale/nl/LC_MESSAGES/django.po b/tracker/locale/nl/LC_MESSAGES/django.po similarity index 100% rename from locale/nl/LC_MESSAGES/django.po rename to tracker/locale/nl/LC_MESSAGES/django.po diff --git a/locale/pl/LC_MESSAGES/django.po b/tracker/locale/pl/LC_MESSAGES/django.po similarity index 100% rename from locale/pl/LC_MESSAGES/django.po rename to tracker/locale/pl/LC_MESSAGES/django.po diff --git a/locale/sv/LC_MESSAGES/django.po b/tracker/locale/sv/LC_MESSAGES/django.po similarity index 100% rename from locale/sv/LC_MESSAGES/django.po rename to tracker/locale/sv/LC_MESSAGES/django.po diff --git a/logutil.py b/tracker/logutil.py similarity index 100% rename from logutil.py rename to tracker/logutil.py diff --git a/lookups.py b/tracker/lookups.py similarity index 100% rename from lookups.py rename to tracker/lookups.py diff --git a/mailutil.py b/tracker/mailutil.py similarity index 100% rename from mailutil.py rename to tracker/mailutil.py diff --git a/management/commands/__init__.py b/tracker/management/__init__.py similarity index 100% rename from management/commands/__init__.py rename to tracker/management/__init__.py diff --git a/migrations/__init__.py b/tracker/management/commands/__init__.py similarity index 100% rename from migrations/__init__.py rename to tracker/management/commands/__init__.py diff --git a/management/commands/cache_giantbomb_info.py b/tracker/management/commands/cache_giantbomb_info.py similarity index 100% rename from management/commands/cache_giantbomb_info.py rename to tracker/management/commands/cache_giantbomb_info.py diff --git a/management/commands/default_email_templates.py b/tracker/management/commands/default_email_templates.py similarity index 100% rename from management/commands/default_email_templates.py rename to tracker/management/commands/default_email_templates.py diff --git a/management/commands/draw_prizes.py b/tracker/management/commands/draw_prizes.py similarity index 100% rename from management/commands/draw_prizes.py rename to tracker/management/commands/draw_prizes.py diff --git a/management/commands/list_email_templates.py b/tracker/management/commands/list_email_templates.py similarity index 100% rename from management/commands/list_email_templates.py rename to tracker/management/commands/list_email_templates.py diff --git a/management/commands/list_events.py b/tracker/management/commands/list_events.py similarity index 100% rename from management/commands/list_events.py rename to tracker/management/commands/list_events.py diff --git a/management/commands/past_due_prizewinners.py b/tracker/management/commands/past_due_prizewinners.py similarity index 100% rename from management/commands/past_due_prizewinners.py rename to tracker/management/commands/past_due_prizewinners.py diff --git a/management/commands/send_activate_prize_handlers_mail.py b/tracker/management/commands/send_activate_prize_handlers_mail.py similarity index 100% rename from management/commands/send_activate_prize_handlers_mail.py rename to tracker/management/commands/send_activate_prize_handlers_mail.py diff --git a/management/commands/send_prize_contributor_emails.py b/tracker/management/commands/send_prize_contributor_emails.py similarity index 100% rename from management/commands/send_prize_contributor_emails.py rename to tracker/management/commands/send_prize_contributor_emails.py diff --git a/management/commands/send_prize_shipped_emails.py b/tracker/management/commands/send_prize_shipped_emails.py similarity index 100% rename from management/commands/send_prize_shipped_emails.py rename to tracker/management/commands/send_prize_shipped_emails.py diff --git a/management/commands/send_prize_winner_accept_emails.py b/tracker/management/commands/send_prize_winner_accept_emails.py similarity index 100% rename from management/commands/send_prize_winner_accept_emails.py rename to tracker/management/commands/send_prize_winner_accept_emails.py diff --git a/management/commands/send_prize_winner_emails.py b/tracker/management/commands/send_prize_winner_emails.py similarity index 100% rename from management/commands/send_prize_winner_emails.py rename to tracker/management/commands/send_prize_winner_emails.py diff --git a/management/commands/send_volunteer_registration_emails.py b/tracker/management/commands/send_volunteer_registration_emails.py similarity index 100% rename from management/commands/send_volunteer_registration_emails.py rename to tracker/management/commands/send_volunteer_registration_emails.py diff --git a/migrations/0001_squashed_0020_add_runner_pronouns_and_platform.py b/tracker/migrations/0001_squashed_0020_add_runner_pronouns_and_platform.py similarity index 100% rename from migrations/0001_squashed_0020_add_runner_pronouns_and_platform.py rename to tracker/migrations/0001_squashed_0020_add_runner_pronouns_and_platform.py diff --git a/migrations/0001_squashed_0039_upgrade_to_19.py b/tracker/migrations/0001_squashed_0039_upgrade_to_19.py similarity index 100% rename from migrations/0001_squashed_0039_upgrade_to_19.py rename to tracker/migrations/0001_squashed_0039_upgrade_to_19.py diff --git a/migrations/0002_add_event_datetime.py b/tracker/migrations/0002_add_event_datetime.py similarity index 100% rename from migrations/0002_add_event_datetime.py rename to tracker/migrations/0002_add_event_datetime.py diff --git a/migrations/0002_add_prev_next_run_to_prize.py b/tracker/migrations/0002_add_prev_next_run_to_prize.py similarity index 100% rename from migrations/0002_add_prev_next_run_to_prize.py rename to tracker/migrations/0002_add_prev_next_run_to_prize.py diff --git a/migrations/0003_backfill_event_datetime.py b/tracker/migrations/0003_backfill_event_datetime.py similarity index 100% rename from migrations/0003_backfill_event_datetime.py rename to tracker/migrations/0003_backfill_event_datetime.py diff --git a/migrations/0003_populate_prev_next_run.py b/tracker/migrations/0003_populate_prev_next_run.py similarity index 100% rename from migrations/0003_populate_prev_next_run.py rename to tracker/migrations/0003_populate_prev_next_run.py diff --git a/migrations/0004_add_paypal_logo_to_event.py b/tracker/migrations/0004_add_paypal_logo_to_event.py similarity index 100% rename from migrations/0004_add_paypal_logo_to_event.py rename to tracker/migrations/0004_add_paypal_logo_to_event.py diff --git a/migrations/0004_remove_event_date.py b/tracker/migrations/0004_remove_event_date.py similarity index 100% rename from migrations/0004_remove_event_date.py rename to tracker/migrations/0004_remove_event_date.py diff --git a/migrations/0005_add_event_hashtag.py b/tracker/migrations/0005_add_event_hashtag.py similarity index 100% rename from migrations/0005_add_event_hashtag.py rename to tracker/migrations/0005_add_event_hashtag.py diff --git a/migrations/0005_add_moderation_filters.py b/tracker/migrations/0005_add_moderation_filters.py similarity index 100% rename from migrations/0005_add_moderation_filters.py rename to tracker/migrations/0005_add_moderation_filters.py diff --git a/migrations/0006_add_on_delete.py b/tracker/migrations/0006_add_on_delete.py similarity index 100% rename from migrations/0006_add_on_delete.py rename to tracker/migrations/0006_add_on_delete.py diff --git a/migrations/0006_alter_runners.py b/tracker/migrations/0006_alter_runners.py similarity index 100% rename from migrations/0006_alter_runners.py rename to tracker/migrations/0006_alter_runners.py diff --git a/migrations/0007_add_prize_key.py b/tracker/migrations/0007_add_prize_key.py similarity index 100% rename from migrations/0007_add_prize_key.py rename to tracker/migrations/0007_add_prize_key.py diff --git a/migrations/0007_event_field_tweaks.py b/tracker/migrations/0007_event_field_tweaks.py similarity index 100% rename from migrations/0007_event_field_tweaks.py rename to tracker/migrations/0007_event_field_tweaks.py diff --git a/migrations/0008_donor_cache_tweaks.py b/tracker/migrations/0008_donor_cache_tweaks.py similarity index 100% rename from migrations/0008_donor_cache_tweaks.py rename to tracker/migrations/0008_donor_cache_tweaks.py diff --git a/migrations/0008_remove_prize_nulls.py b/tracker/migrations/0008_remove_prize_nulls.py similarity index 100% rename from migrations/0008_remove_prize_nulls.py rename to tracker/migrations/0008_remove_prize_nulls.py diff --git a/migrations/0009_remove_prize_nulls_pt2.py b/tracker/migrations/0009_remove_prize_nulls_pt2.py similarity index 100% rename from migrations/0009_remove_prize_nulls_pt2.py rename to tracker/migrations/0009_remove_prize_nulls_pt2.py diff --git a/migrations/0010_remove_paypal_sandbox.py b/tracker/migrations/0010_remove_paypal_sandbox.py similarity index 100% rename from migrations/0010_remove_paypal_sandbox.py rename to tracker/migrations/0010_remove_paypal_sandbox.py diff --git a/migrations/0011_add_one_step_screening.py b/tracker/migrations/0011_add_one_step_screening.py similarity index 100% rename from migrations/0011_add_one_step_screening.py rename to tracker/migrations/0011_add_one_step_screening.py diff --git a/migrations/0012_add_index_to_bid_state.py b/tracker/migrations/0012_add_index_to_bid_state.py similarity index 100% rename from migrations/0012_add_index_to_bid_state.py rename to tracker/migrations/0012_add_index_to_bid_state.py diff --git a/migrations/0013_add_bid_option_max_length.py b/tracker/migrations/0013_add_bid_option_max_length.py similarity index 100% rename from migrations/0013_add_bid_option_max_length.py rename to tracker/migrations/0013_add_bid_option_max_length.py diff --git a/migrations/0014_add_event_auto_approve_threshold.py b/tracker/migrations/0014_add_event_auto_approve_threshold.py similarity index 100% rename from migrations/0014_add_event_auto_approve_threshold.py rename to tracker/migrations/0014_add_event_auto_approve_threshold.py diff --git a/migrations/0015_add_allow_donations.py b/tracker/migrations/0015_add_allow_donations.py similarity index 100% rename from migrations/0015_add_allow_donations.py rename to tracker/migrations/0015_add_allow_donations.py diff --git a/migrations/0015_add_speedrun_twitch_name.py b/tracker/migrations/0015_add_speedrun_twitch_name.py similarity index 100% rename from migrations/0015_add_speedrun_twitch_name.py rename to tracker/migrations/0015_add_speedrun_twitch_name.py diff --git a/migrations/0016_merge_20190914_1249.py b/tracker/migrations/0016_merge_20190914_1249.py similarity index 100% rename from migrations/0016_merge_20190914_1249.py rename to tracker/migrations/0016_merge_20190914_1249.py diff --git a/migrations/0017_fix_missing_migrations.py b/tracker/migrations/0017_fix_missing_migrations.py similarity index 100% rename from migrations/0017_fix_missing_migrations.py rename to tracker/migrations/0017_fix_missing_migrations.py diff --git a/migrations/0018_remove_prize_ticket.py b/tracker/migrations/0018_remove_prize_ticket.py similarity index 100% rename from migrations/0018_remove_prize_ticket.py rename to tracker/migrations/0018_remove_prize_ticket.py diff --git a/migrations/0019_add_uniqueness_message_runner_name.py b/tracker/migrations/0019_add_uniqueness_message_runner_name.py similarity index 100% rename from migrations/0019_add_uniqueness_message_runner_name.py rename to tracker/migrations/0019_add_uniqueness_message_runner_name.py diff --git a/migrations/0020_add_runner_pronouns_and_platform.py b/tracker/migrations/0020_add_runner_pronouns_and_platform.py similarity index 100% rename from migrations/0020_add_runner_pronouns_and_platform.py rename to tracker/migrations/0020_add_runner_pronouns_and_platform.py diff --git a/templatetags/__init__.py b/tracker/migrations/__init__.py similarity index 100% rename from templatetags/__init__.py rename to tracker/migrations/__init__.py diff --git a/models/__init__.py b/tracker/models/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from models/__init__.py rename to tracker/models/__init__.py diff --git a/models/bid.py b/tracker/models/bid.py old mode 100755 new mode 100644 similarity index 100% rename from models/bid.py rename to tracker/models/bid.py diff --git a/models/country.py b/tracker/models/country.py similarity index 100% rename from models/country.py rename to tracker/models/country.py diff --git a/models/donation.py b/tracker/models/donation.py old mode 100755 new mode 100644 similarity index 100% rename from models/donation.py rename to tracker/models/donation.py diff --git a/models/event.py b/tracker/models/event.py old mode 100755 new mode 100644 similarity index 100% rename from models/event.py rename to tracker/models/event.py diff --git a/models/fields.py b/tracker/models/fields.py similarity index 100% rename from models/fields.py rename to tracker/models/fields.py diff --git a/models/log.py b/tracker/models/log.py similarity index 100% rename from models/log.py rename to tracker/models/log.py diff --git a/models/mod_filter.py b/tracker/models/mod_filter.py similarity index 100% rename from models/mod_filter.py rename to tracker/models/mod_filter.py diff --git a/models/prize.py b/tracker/models/prize.py old mode 100755 new mode 100644 similarity index 99% rename from models/prize.py rename to tracker/models/prize.py index 00d7d0ac2..4d993ad2b --- a/models/prize.py +++ b/tracker/models/prize.py @@ -703,13 +703,6 @@ def accept_deadline_date(self): else: return None - def make_winner_url(self, domain=settings.DOMAIN): - return ( - domain - + reverse('tracker:prize_winner', args=[self.pk]) - + '?auth_code={0}'.format(self.auth_code) - ) - def check_multiwin(self, value): if value > self.prize.maxmultiwin: raise ValidationError( diff --git a/models/profile.py b/tracker/models/profile.py similarity index 100% rename from models/profile.py rename to tracker/models/profile.py diff --git a/models/util.py b/tracker/models/util.py similarity index 100% rename from models/util.py rename to tracker/models/util.py diff --git a/paypalutil.py b/tracker/paypalutil.py similarity index 100% rename from paypalutil.py rename to tracker/paypalutil.py diff --git a/prizemail.py b/tracker/prizemail.py similarity index 99% rename from prizemail.py rename to tracker/prizemail.py index 0a9f1ac01..55983b604 100644 --- a/prizemail.py +++ b/tracker/prizemail.py @@ -76,12 +76,12 @@ def automail_prize_winners( mailTemplate, sender=None, replyTo=None, - domain=settings.DOMAIN, verbosity=0, dry_run=False, ): sender, replyTo = event_sender_replyto_defaults(event, sender, replyTo) + # TODO: write this with groupby winnerDict = {} for prizeWinner in prizeWinners: if prizeWinner.winner.id in winnerDict.keys(): diff --git a/prizeutil.py b/tracker/prizeutil.py similarity index 100% rename from prizeutil.py rename to tracker/prizeutil.py diff --git a/routing.py b/tracker/routing.py similarity index 100% rename from routing.py rename to tracker/routing.py diff --git a/search_feeds.py b/tracker/search_feeds.py similarity index 100% rename from search_feeds.py rename to tracker/search_feeds.py diff --git a/search_filters.py b/tracker/search_filters.py similarity index 100% rename from search_filters.py rename to tracker/search_filters.py diff --git a/serializers.py b/tracker/serializers.py similarity index 100% rename from serializers.py rename to tracker/serializers.py diff --git a/static/ProcessingNode.js b/tracker/static/ProcessingNode.js similarity index 100% rename from static/ProcessingNode.js rename to tracker/static/ProcessingNode.js diff --git a/static/admin/donation.css b/tracker/static/admin/donation.css similarity index 100% rename from static/admin/donation.css rename to tracker/static/admin/donation.css diff --git a/static/adminprocessing.css b/tracker/static/adminprocessing.css similarity index 100% rename from static/adminprocessing.css rename to tracker/static/adminprocessing.css diff --git a/static/adminprocessing.js b/tracker/static/adminprocessing.js similarity index 100% rename from static/adminprocessing.js rename to tracker/static/adminprocessing.js diff --git a/static/asc.png b/tracker/static/asc.png similarity index 100% rename from static/asc.png rename to tracker/static/asc.png diff --git a/static/date.format.js b/tracker/static/date.format.js similarity index 100% rename from static/date.format.js rename to tracker/static/date.format.js diff --git a/static/donate.css b/tracker/static/donate.css similarity index 100% rename from static/donate.css rename to tracker/static/donate.css diff --git a/static/donationbids.js b/tracker/static/donationbids.js similarity index 100% rename from static/donationbids.js rename to tracker/static/donationbids.js diff --git a/static/dsc.png b/tracker/static/dsc.png similarity index 100% rename from static/dsc.png rename to tracker/static/dsc.png diff --git a/static/first.png b/tracker/static/first.png similarity index 100% rename from static/first.png rename to tracker/static/first.png diff --git a/static/images/ui-icons_222222_256x240.png b/tracker/static/images/ui-icons_222222_256x240.png similarity index 100% rename from static/images/ui-icons_222222_256x240.png rename to tracker/static/images/ui-icons_222222_256x240.png diff --git a/static/jquery-ui.css b/tracker/static/jquery-ui.css similarity index 100% rename from static/jquery-ui.css rename to tracker/static/jquery-ui.css diff --git a/static/jquery-ui.js b/tracker/static/jquery-ui.js similarity index 100% rename from static/jquery-ui.js rename to tracker/static/jquery-ui.js diff --git a/static/jquery-ui.min.js b/tracker/static/jquery-ui.min.js similarity index 100% rename from static/jquery-ui.min.js rename to tracker/static/jquery-ui.min.js diff --git a/static/jquery.cookie.js b/tracker/static/jquery.cookie.js similarity index 100% rename from static/jquery.cookie.js rename to tracker/static/jquery.cookie.js diff --git a/static/jquery.datetimepicker.css b/tracker/static/jquery.datetimepicker.css similarity index 100% rename from static/jquery.datetimepicker.css rename to tracker/static/jquery.datetimepicker.css diff --git a/static/jquery.datetimepicker.js b/tracker/static/jquery.datetimepicker.js similarity index 100% rename from static/jquery.datetimepicker.js rename to tracker/static/jquery.datetimepicker.js diff --git a/static/jquery.formset.js b/tracker/static/jquery.formset.js similarity index 100% rename from static/jquery.formset.js rename to tracker/static/jquery.formset.js diff --git a/static/jquery.js b/tracker/static/jquery.js similarity index 100% rename from static/jquery.js rename to tracker/static/jquery.js diff --git a/static/jquery.min.js b/tracker/static/jquery.min.js similarity index 100% rename from static/jquery.min.js rename to tracker/static/jquery.min.js diff --git a/static/last.png b/tracker/static/last.png similarity index 100% rename from static/last.png rename to tracker/static/last.png diff --git a/static/main.css b/tracker/static/main.css similarity index 100% rename from static/main.css rename to tracker/static/main.css diff --git a/static/next.png b/tracker/static/next.png similarity index 100% rename from static/next.png rename to tracker/static/next.png diff --git a/static/prev.png b/tracker/static/prev.png similarity index 100% rename from static/prev.png rename to tracker/static/prev.png diff --git a/static/queueindex.css b/tracker/static/queueindex.css similarity index 100% rename from static/queueindex.css rename to tracker/static/queueindex.css diff --git a/templates/404.html b/tracker/templates/404.html similarity index 100% rename from templates/404.html rename to tracker/templates/404.html diff --git a/templates/500.html b/tracker/templates/500.html similarity index 100% rename from templates/500.html rename to tracker/templates/500.html diff --git a/templates/admin/automail_prize_contributors.html b/tracker/templates/admin/automail_prize_contributors.html similarity index 100% rename from templates/admin/automail_prize_contributors.html rename to tracker/templates/admin/automail_prize_contributors.html diff --git a/templates/admin/automail_prize_contributors_post.html b/tracker/templates/admin/automail_prize_contributors_post.html similarity index 100% rename from templates/admin/automail_prize_contributors_post.html rename to tracker/templates/admin/automail_prize_contributors_post.html diff --git a/templates/admin/automail_prize_winners.html b/tracker/templates/admin/automail_prize_winners.html similarity index 100% rename from templates/admin/automail_prize_winners.html rename to tracker/templates/admin/automail_prize_winners.html diff --git a/templates/admin/automail_prize_winners_accept_notifications.html b/tracker/templates/admin/automail_prize_winners_accept_notifications.html similarity index 100% rename from templates/admin/automail_prize_winners_accept_notifications.html rename to tracker/templates/admin/automail_prize_winners_accept_notifications.html diff --git a/templates/admin/automail_prize_winners_accept_notifications_post.html b/tracker/templates/admin/automail_prize_winners_accept_notifications_post.html similarity index 100% rename from templates/admin/automail_prize_winners_accept_notifications_post.html rename to tracker/templates/admin/automail_prize_winners_accept_notifications_post.html diff --git a/templates/admin/automail_prize_winners_post.html b/tracker/templates/admin/automail_prize_winners_post.html similarity index 100% rename from templates/admin/automail_prize_winners_post.html rename to tracker/templates/admin/automail_prize_winners_post.html diff --git a/templates/admin/automail_prize_winners_shipping_notifications.html b/tracker/templates/admin/automail_prize_winners_shipping_notifications.html similarity index 100% rename from templates/admin/automail_prize_winners_shipping_notifications.html rename to tracker/templates/admin/automail_prize_winners_shipping_notifications.html diff --git a/templates/admin/automail_prize_winners_shipping_notifications_post.html b/tracker/templates/admin/automail_prize_winners_shipping_notifications_post.html similarity index 100% rename from templates/admin/automail_prize_winners_shipping_notifications_post.html rename to tracker/templates/admin/automail_prize_winners_shipping_notifications_post.html diff --git a/templates/admin/draw_prize_winners.html b/tracker/templates/admin/draw_prize_winners.html similarity index 100% rename from templates/admin/draw_prize_winners.html rename to tracker/templates/admin/draw_prize_winners.html diff --git a/templates/admin/draw_prize_winners_post.html b/tracker/templates/admin/draw_prize_winners_post.html similarity index 100% rename from templates/admin/draw_prize_winners_post.html rename to tracker/templates/admin/draw_prize_winners_post.html diff --git a/templates/admin/generic_form.html b/tracker/templates/admin/generic_form.html similarity index 100% rename from templates/admin/generic_form.html rename to tracker/templates/admin/generic_form.html diff --git a/templates/admin/merge_bids.html b/tracker/templates/admin/merge_bids.html similarity index 100% rename from templates/admin/merge_bids.html rename to tracker/templates/admin/merge_bids.html diff --git a/templates/admin/merge_donors.html b/tracker/templates/admin/merge_donors.html similarity index 100% rename from templates/admin/merge_donors.html rename to tracker/templates/admin/merge_donors.html diff --git a/templates/admin/process_donations.html b/tracker/templates/admin/process_donations.html similarity index 100% rename from templates/admin/process_donations.html rename to tracker/templates/admin/process_donations.html diff --git a/templates/admin/process_pending_bids.html b/tracker/templates/admin/process_pending_bids.html similarity index 100% rename from templates/admin/process_pending_bids.html rename to tracker/templates/admin/process_pending_bids.html diff --git a/templates/admin/process_prize_submissions.html b/tracker/templates/admin/process_prize_submissions.html similarity index 100% rename from templates/admin/process_prize_submissions.html rename to tracker/templates/admin/process_prize_submissions.html diff --git a/templates/admin/read_donations.html b/tracker/templates/admin/read_donations.html similarity index 100% rename from templates/admin/read_donations.html rename to tracker/templates/admin/read_donations.html diff --git a/templates/admin/select_event.html b/tracker/templates/admin/select_event.html similarity index 100% rename from templates/admin/select_event.html rename to tracker/templates/admin/select_event.html diff --git a/templates/admin/tracker_admin.html b/tracker/templates/admin/tracker_admin.html similarity index 100% rename from templates/admin/tracker_admin.html rename to tracker/templates/admin/tracker_admin.html diff --git a/templates/base.html b/tracker/templates/base.html similarity index 100% rename from templates/base.html rename to tracker/templates/base.html diff --git a/templates/form_innards.html b/tracker/templates/form_innards.html similarity index 100% rename from templates/form_innards.html rename to tracker/templates/form_innards.html diff --git a/templates/standardform.html b/tracker/templates/standardform.html similarity index 100% rename from templates/standardform.html rename to tracker/templates/standardform.html diff --git a/templates/tracker/badobject.html b/tracker/templates/tracker/badobject.html similarity index 100% rename from templates/tracker/badobject.html rename to tracker/templates/tracker/badobject.html diff --git a/templates/tracker/bid.html b/tracker/templates/tracker/bid.html similarity index 100% rename from templates/tracker/bid.html rename to tracker/templates/tracker/bid.html diff --git a/templates/tracker/bidindex.html b/tracker/templates/tracker/bidindex.html similarity index 100% rename from templates/tracker/bidindex.html rename to tracker/templates/tracker/bidindex.html diff --git a/templates/tracker/bidtitle.html b/tracker/templates/tracker/bidtitle.html similarity index 100% rename from templates/tracker/bidtitle.html rename to tracker/templates/tracker/bidtitle.html diff --git a/templates/tracker/confirm_registration.html b/tracker/templates/tracker/confirm_registration.html similarity index 100% rename from templates/tracker/confirm_registration.html rename to tracker/templates/tracker/confirm_registration.html diff --git a/templates/tracker/confirm_registration_done.html b/tracker/templates/tracker/confirm_registration_done.html similarity index 100% rename from templates/tracker/confirm_registration_done.html rename to tracker/templates/tracker/confirm_registration_done.html diff --git a/templates/tracker/contributor_prize.html b/tracker/templates/tracker/contributor_prize.html similarity index 100% rename from templates/tracker/contributor_prize.html rename to tracker/templates/tracker/contributor_prize.html diff --git a/templates/tracker/donate.html b/tracker/templates/tracker/donate.html similarity index 100% rename from templates/tracker/donate.html rename to tracker/templates/tracker/donate.html diff --git a/templates/tracker/donation.html b/tracker/templates/tracker/donation.html similarity index 100% rename from templates/tracker/donation.html rename to tracker/templates/tracker/donation.html diff --git a/templates/tracker/donationindex.html b/tracker/templates/tracker/donationindex.html similarity index 100% rename from templates/tracker/donationindex.html rename to tracker/templates/tracker/donationindex.html diff --git a/templates/tracker/donor.html b/tracker/templates/tracker/donor.html similarity index 100% rename from templates/tracker/donor.html rename to tracker/templates/tracker/donor.html diff --git a/templates/tracker/donorindex.html b/tracker/templates/tracker/donorindex.html similarity index 100% rename from templates/tracker/donorindex.html rename to tracker/templates/tracker/donorindex.html diff --git a/templates/tracker/email/default_activate_prize_handlers.html b/tracker/templates/tracker/email/default_activate_prize_handlers.html similarity index 100% rename from templates/tracker/email/default_activate_prize_handlers.html rename to tracker/templates/tracker/email/default_activate_prize_handlers.html diff --git a/templates/tracker/email/default_prize_contributor.html b/tracker/templates/tracker/email/default_prize_contributor.html similarity index 100% rename from templates/tracker/email/default_prize_contributor.html rename to tracker/templates/tracker/email/default_prize_contributor.html diff --git a/templates/tracker/email/default_prize_shipping.html b/tracker/templates/tracker/email/default_prize_shipping.html similarity index 100% rename from templates/tracker/email/default_prize_shipping.html rename to tracker/templates/tracker/email/default_prize_shipping.html diff --git a/templates/tracker/email/default_prize_winner_accept.html b/tracker/templates/tracker/email/default_prize_winner_accept.html similarity index 100% rename from templates/tracker/email/default_prize_winner_accept.html rename to tracker/templates/tracker/email/default_prize_winner_accept.html diff --git a/templates/tracker/email/default_prize_winner_template.html b/tracker/templates/tracker/email/default_prize_winner_template.html similarity index 100% rename from templates/tracker/email/default_prize_winner_template.html rename to tracker/templates/tracker/email/default_prize_winner_template.html diff --git a/templates/tracker/email/password_reset.html b/tracker/templates/tracker/email/password_reset.html similarity index 100% rename from templates/tracker/email/password_reset.html rename to tracker/templates/tracker/email/password_reset.html diff --git a/templates/tracker/email/password_reset.txt b/tracker/templates/tracker/email/password_reset.txt similarity index 100% rename from templates/tracker/email/password_reset.txt rename to tracker/templates/tracker/email/password_reset.txt diff --git a/templates/tracker/eventlist.html b/tracker/templates/tracker/eventlist.html similarity index 100% rename from templates/tracker/eventlist.html rename to tracker/templates/tracker/eventlist.html diff --git a/templates/tracker/index.html b/tracker/templates/tracker/index.html similarity index 100% rename from templates/tracker/index.html rename to tracker/templates/tracker/index.html diff --git a/templates/tracker/index_blanknav.html b/tracker/templates/tracker/index_blanknav.html similarity index 100% rename from templates/tracker/index_blanknav.html rename to tracker/templates/tracker/index_blanknav.html diff --git a/templates/tracker/login.html b/tracker/templates/tracker/login.html similarity index 100% rename from templates/tracker/login.html rename to tracker/templates/tracker/login.html diff --git a/templates/tracker/logout.html b/tracker/templates/tracker/logout.html similarity index 100% rename from templates/tracker/logout.html rename to tracker/templates/tracker/logout.html diff --git a/templates/tracker/partials/comment.html b/tracker/templates/tracker/partials/comment.html similarity index 100% rename from templates/tracker/partials/comment.html rename to tracker/templates/tracker/partials/comment.html diff --git a/templates/tracker/partials/commentslink.html b/tracker/templates/tracker/partials/commentslink.html similarity index 100% rename from templates/tracker/partials/commentslink.html rename to tracker/templates/tracker/partials/commentslink.html diff --git a/templates/tracker/partials/donor_address.html b/tracker/templates/tracker/partials/donor_address.html similarity index 100% rename from templates/tracker/partials/donor_address.html rename to tracker/templates/tracker/partials/donor_address.html diff --git a/templates/tracker/partials/donor_link.html b/tracker/templates/tracker/partials/donor_link.html similarity index 100% rename from templates/tracker/partials/donor_link.html rename to tracker/templates/tracker/partials/donor_link.html diff --git a/templates/tracker/partials/language.html b/tracker/templates/tracker/partials/language.html similarity index 100% rename from templates/tracker/partials/language.html rename to tracker/templates/tracker/partials/language.html diff --git a/templates/tracker/partials/navfooter.html b/tracker/templates/tracker/partials/navfooter.html similarity index 100% rename from templates/tracker/partials/navfooter.html rename to tracker/templates/tracker/partials/navfooter.html diff --git a/templates/tracker/partials/option.html b/tracker/templates/tracker/partials/option.html similarity index 100% rename from templates/tracker/partials/option.html rename to tracker/templates/tracker/partials/option.html diff --git a/templates/tracker/partials/optionstable.html b/tracker/templates/tracker/partials/optionstable.html similarity index 100% rename from templates/tracker/partials/optionstable.html rename to tracker/templates/tracker/partials/optionstable.html diff --git a/templates/tracker/partials/pagefooter.html b/tracker/templates/tracker/partials/pagefooter.html similarity index 100% rename from templates/tracker/partials/pagefooter.html rename to tracker/templates/tracker/partials/pagefooter.html diff --git a/templates/tracker/password_change.html b/tracker/templates/tracker/password_change.html similarity index 100% rename from templates/tracker/password_change.html rename to tracker/templates/tracker/password_change.html diff --git a/templates/tracker/password_change_done.html b/tracker/templates/tracker/password_change_done.html similarity index 100% rename from templates/tracker/password_change_done.html rename to tracker/templates/tracker/password_change_done.html diff --git a/templates/tracker/password_reset.html b/tracker/templates/tracker/password_reset.html similarity index 100% rename from templates/tracker/password_reset.html rename to tracker/templates/tracker/password_reset.html diff --git a/templates/tracker/password_reset_complete.html b/tracker/templates/tracker/password_reset_complete.html similarity index 100% rename from templates/tracker/password_reset_complete.html rename to tracker/templates/tracker/password_reset_complete.html diff --git a/templates/tracker/password_reset_confirm.html b/tracker/templates/tracker/password_reset_confirm.html similarity index 100% rename from templates/tracker/password_reset_confirm.html rename to tracker/templates/tracker/password_reset_confirm.html diff --git a/templates/tracker/password_reset_done.html b/tracker/templates/tracker/password_reset_done.html similarity index 100% rename from templates/tracker/password_reset_done.html rename to tracker/templates/tracker/password_reset_done.html diff --git a/templates/tracker/paypal_cancel.html b/tracker/templates/tracker/paypal_cancel.html similarity index 100% rename from templates/tracker/paypal_cancel.html rename to tracker/templates/tracker/paypal_cancel.html diff --git a/templates/tracker/paypal_redirect.html b/tracker/templates/tracker/paypal_redirect.html similarity index 100% rename from templates/tracker/paypal_redirect.html rename to tracker/templates/tracker/paypal_redirect.html diff --git a/templates/tracker/paypal_return.html b/tracker/templates/tracker/paypal_return.html similarity index 100% rename from templates/tracker/paypal_return.html rename to tracker/templates/tracker/paypal_return.html diff --git a/templates/tracker/prize.html b/tracker/templates/tracker/prize.html similarity index 100% rename from templates/tracker/prize.html rename to tracker/templates/tracker/prize.html diff --git a/templates/tracker/prize_winner.html b/tracker/templates/tracker/prize_winner.html similarity index 100% rename from templates/tracker/prize_winner.html rename to tracker/templates/tracker/prize_winner.html diff --git a/templates/tracker/prizeindex.html b/tracker/templates/tracker/prizeindex.html similarity index 100% rename from templates/tracker/prizeindex.html rename to tracker/templates/tracker/prizeindex.html diff --git a/templates/tracker/register.html b/tracker/templates/tracker/register.html similarity index 100% rename from templates/tracker/register.html rename to tracker/templates/tracker/register.html diff --git a/templates/tracker/register_done.html b/tracker/templates/tracker/register_done.html similarity index 100% rename from templates/tracker/register_done.html rename to tracker/templates/tracker/register_done.html diff --git a/templates/tracker/run.html b/tracker/templates/tracker/run.html similarity index 100% rename from templates/tracker/run.html rename to tracker/templates/tracker/run.html diff --git a/templates/tracker/runindex.html b/tracker/templates/tracker/runindex.html similarity index 100% rename from templates/tracker/runindex.html rename to tracker/templates/tracker/runindex.html diff --git a/templates/tracker/submit_prize.html b/tracker/templates/tracker/submit_prize.html similarity index 100% rename from templates/tracker/submit_prize.html rename to tracker/templates/tracker/submit_prize.html diff --git a/templates/tracker/submit_prize_success.html b/tracker/templates/tracker/submit_prize_success.html similarity index 100% rename from templates/tracker/submit_prize_success.html rename to tracker/templates/tracker/submit_prize_success.html diff --git a/templates/tracker/user_index.html b/tracker/templates/tracker/user_index.html similarity index 100% rename from templates/tracker/user_index.html rename to tracker/templates/tracker/user_index.html diff --git a/templates/tracker/websocket.html b/tracker/templates/tracker/websocket.html similarity index 100% rename from templates/tracker/websocket.html rename to tracker/templates/tracker/websocket.html diff --git a/templates/ui/index.html b/tracker/templates/ui/index.html similarity index 100% rename from templates/ui/index.html rename to tracker/templates/ui/index.html diff --git a/ui/__init__.py b/tracker/templatetags/__init__.py similarity index 100% rename from ui/__init__.py rename to tracker/templatetags/__init__.py diff --git a/templatetags/donation_tags.py b/tracker/templatetags/donation_tags.py old mode 100755 new mode 100644 similarity index 100% rename from templatetags/donation_tags.py rename to tracker/templatetags/donation_tags.py diff --git a/tracker/ui/__init__.py b/tracker/ui/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/ui/urls.py b/tracker/ui/urls.py similarity index 100% rename from ui/urls.py rename to tracker/ui/urls.py diff --git a/ui/views.py b/tracker/ui/views.py similarity index 100% rename from ui/views.py rename to tracker/ui/views.py diff --git a/urls.py b/tracker/urls.py old mode 100755 new mode 100644 similarity index 100% rename from urls.py rename to tracker/urls.py diff --git a/util.py b/tracker/util.py similarity index 100% rename from util.py rename to tracker/util.py diff --git a/validators.py b/tracker/validators.py similarity index 100% rename from validators.py rename to tracker/validators.py diff --git a/views/__init__.py b/tracker/views/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from views/__init__.py rename to tracker/views/__init__.py diff --git a/views/api.py b/tracker/views/api.py old mode 100755 new mode 100644 similarity index 100% rename from views/api.py rename to tracker/views/api.py diff --git a/views/auth.py b/tracker/views/auth.py similarity index 100% rename from views/auth.py rename to tracker/views/auth.py diff --git a/views/commands.py b/tracker/views/commands.py old mode 100755 new mode 100644 similarity index 100% rename from views/commands.py rename to tracker/views/commands.py diff --git a/views/common.py b/tracker/views/common.py similarity index 100% rename from views/common.py rename to tracker/views/common.py diff --git a/views/donateviews.py b/tracker/views/donateviews.py similarity index 100% rename from views/donateviews.py rename to tracker/views/donateviews.py diff --git a/views/public.py b/tracker/views/public.py similarity index 100% rename from views/public.py rename to tracker/views/public.py diff --git a/views/user.py b/tracker/views/user.py similarity index 100% rename from views/user.py rename to tracker/views/user.py diff --git a/viewutil.py b/tracker/viewutil.py similarity index 100% rename from viewutil.py rename to tracker/viewutil.py diff --git a/volunteer.py b/tracker/volunteer.py similarity index 100% rename from volunteer.py rename to tracker/volunteer.py diff --git a/widgets.py b/tracker/widgets.py similarity index 100% rename from widgets.py rename to tracker/widgets.py diff --git a/webpack.config.js b/webpack.config.js index ce4cd4309..c62480bee 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,7 @@ const webpack = require('webpack'); -const keyMirror = require('keymirror'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const WebpackManifestPlugin = require('webpack-yam-plugin'); const path = require('path'); -const packageJSON = require('./package'); const TerserPlugin = require('terser-webpack-plugin'); const PROD = process.env.NODE_ENV === 'production'; @@ -25,9 +23,10 @@ module.exports = { output: { filename: PROD ? 'tracker-[name]-[hash].js' : 'tracker-[name].js', pathinfo: true, - path: __dirname + '/static/gen', + path: __dirname + '/tracker/static/gen', publicPath: '/static/gen', }, + stats: 'minimal', module: { rules: [ { @@ -99,14 +98,13 @@ module.exports = { }), ], }, - externals: keyMirror(packageJSON.dependencies), devServer: PROD ? {} : { proxy: [ { context: ['/admin', '/logout', '/api', '/ui', '/static', '/tracker', '/donate', '/media'], - target: 'http://localhost:8000/', + target: process.env.TRACKER_HOST || 'http://localhost:8000/', headers: { 'X-Webpack': 1 }, ws: true, }, @@ -116,8 +114,8 @@ module.exports = { plugins: [ new webpack.optimize.OccurrenceOrderPlugin(), new WebpackManifestPlugin({ - manifestPath: __dirname + '/ui-tracker.manifest.json', - outputRoot: __dirname + '/static', + manifestPath: __dirname + '/tracker/ui-tracker.manifest.json', + outputRoot: __dirname + '/tracker/static', }), new MiniCssExtractPlugin({ filename: PROD ? 'tracker-[name]-[hash].css' : 'tracker-[name].css', diff --git a/yarn.lock b/yarn.lock index 5e4efd721..a4dcb8b7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3897,13 +3897,6 @@ create-react-context@^0.3.0: gud "^1.0.0" warning "^4.0.3" -cross-env@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.3.tgz#4256b71e49b3a40637a0ce70768a6ef5c72ae941" - integrity sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag== - dependencies: - cross-spawn "^7.0.0" - cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -3924,15 +3917,6 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" - integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -8217,11 +8201,6 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-key@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" - integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== - path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -10293,23 +10272,11 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - shell-quote@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" @@ -11703,13 +11670,6 @@ which@^1.2.1, which@^1.2.14, which@^1.2.9, which@^1.3.1: dependencies: isexe "^2.0.0" -which@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.1.tgz#f1cf94d07a8e571b6ff006aeb91d0300c47ef0a4" - integrity sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w== - dependencies: - isexe "^2.0.0" - wide-align@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710"