diff --git a/README.md b/README.md index 28e6beb..6bb9a21 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ docker-compose run --rm app python make nightly docker-compose run --rm app python manage.py make_search_index ``` +To enable candidate merging for local development, create an admin user (`python manage.py createsuperuser`) and turn on database caching by adding `DJANGO_CACHE_BACKEND: "db.DatabaseCache"` to the environment block in `docker-compose.yml`. (django-select2 requires a persistent cache.) _This step is not necessary if you do not need to test merge functionality._ + Finally, run the app: ```bash diff --git a/camp_fin/settings.py b/camp_fin/settings.py index c437a21..f032839 100644 --- a/camp_fin/settings.py +++ b/camp_fin/settings.py @@ -190,8 +190,9 @@ # Caching -cache_backend = "dummy.DummyCache" if DEBUG is True else "db.DatabaseCache" -cache_backend = "db.DatabaseCache" +cache_backend = os.getenv( + "DJANGO_CACHE_BACKEND", "dummy.DummyCache" if DEBUG else "db.DatabaseCache" +) CACHES = { "default": { "BACKEND": f"django.core.cache.backends.{cache_backend}", diff --git a/camp_fin/static/css/custom.css b/camp_fin/static/css/custom.css index 41c781a..9fc2977 100644 --- a/camp_fin/static/css/custom.css +++ b/camp_fin/static/css/custom.css @@ -472,3 +472,7 @@ h4 small { #redaction-form td { padding: 10px; } + +.alert-info .select2-selection__choice { + color: #000; +} diff --git a/camp_fin/templates/camp_fin/candidate-detail.html b/camp_fin/templates/camp_fin/candidate-detail.html index a532180..901794e 100644 --- a/camp_fin/templates/camp_fin/candidate-detail.html +++ b/camp_fin/templates/camp_fin/candidate-detail.html @@ -36,23 +36,36 @@

Related stories

{% endif %} -
-
- {% if messages %} - -{% endif %} -
- {% csrf_token %} - {{ form.as_p }} - -
- - {{ form.media.js }} -
+ {% if user.is_authenticated %} +
+
+ +
+
+ {% endif %}