Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/change_log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Check Chanelog Exists
- name: Check Changelog Extension
run: |
if [[ $(ls ./changes/$??{{ github.event.number }}.*) ]]; then
if [[ $(ls ./changes/${{ github.event.number }}.*) ]]; then
echo -e "\n"
echo -e "\033[0;36mINFO: changelog for PR ${{ github.event.number }} exists.\033[0;0m"
echo -e "\n"
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Check Changelog Extension
run: |
fullfile=$(ls ./changes/??${{ github.event.number }}.*)
fullfile=$(ls ./changes/${{ github.event.number }}.*)
filename=$(basename -- "$fullfile")
extension="${filename##*.}"
allowed_types='[ "fix", "bugfix", "hotfix", "feature", "misc", "changes", "migration", "removal", "release" ]'
Expand Down
16 changes: 11 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ celerybeat.pid
.venv
env/
venv/
dj4env/
dj5env/
ENV/
env.bak/
venv.bak/
tstenv/

# Spyder project settings
.spyderproject
Expand All @@ -132,6 +135,9 @@ venv.bak/
.dmypy.json
dmypy.json

# JetBrains IDEs
.idea/

# Pyre type checker
.pyre/

Expand All @@ -145,18 +151,14 @@ dmypy.json
cython_debug/

# Search Application
/data/*.csv
/data/*.txt
/data/*.yaml
/data/*.json
/data/
/search/migrations/*.py
/search/plugins/*.py
!/search/plugins/default.py
/oc_search/settings.py
/search/templates/snippets/custom/
/locale/fr/LC_MESSAGES/*.po
!/locale/fr/LC_MESSAGES/django_core.po
# Don't include file-based sessions
/session/
!/session/NOTE.md
*.deprecated
Expand All @@ -168,6 +170,7 @@ cython_debug/
/search/management/commands/nap5_*.py
/search/management/commands/reclassification_*.py
/search/management/commands/qpnotes_*.py
/search/migrations_backup/
/nltk/corpora
/nltk/tokenizers
/nltk/*.model
Expand All @@ -178,3 +181,6 @@ cython_debug/
!/search/data/Readme.md
# Don't include custom tests
/tests/test_*.py
/ramp/viewer/
/cdts/
/search/templates/snippets/im/
7 changes: 7 additions & 0 deletions changes/54.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Upgraded the Django framework to version 5. Manual database upgrade for the
django_celery_results extenstion required for move to version 2.6.0. Plase note
that CDTS must be reamin at version 5.0.1 for now.
Note that for Django-celery-results version 2.6.0, a database change is required.

python .\manage.py migrate django_celery_results --fake zero
python .\manage.py migrate django_celery_results 0001
22 changes: 1 addition & 21 deletions oc_search/settings-sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
# Application definition

INSTALLED_APPS = [
'corsheaders',
'jazzmin',
'django_celery_beat',
'django_celery_results',
Expand All @@ -45,11 +44,11 @@
'django.contrib.staticfiles',
'qurl_templatetag',
'search',
'ramp',
]

## Optional applications
# 'ramp',
# 'smuggler',
MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
'django.middleware.security.SecurityMiddleware',
Expand Down Expand Up @@ -122,12 +121,6 @@

JSON_DOWNLOADS_ALLOWED = False

# Smuggler settings
SMUGGLER_FIXTURE_DIR = os.path.join(BASE_DIR, 'smuggler')
SMUGGLER_EXCLUDE_LIST = ['admin.logentry', 'auth.permission', 'auth.group', 'auth.user',
'contenttypes.contenttype',
'django_celery_results.chordcounter', 'django_celery_results.groupresult', 'django_celery_beat.taskresult']

# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

Expand Down Expand Up @@ -308,19 +301,6 @@
SEARCH_LOGGING_ARCHIVE_FILE = os.path.join(BASE_DIR, 'data', 'search_logs.log')
SEARCH_LOGGING_ARCHIVE_AFTER_X_DAYS = 7

# Used by the Suggested Datasets Search if enabled

SD_COMMENTS_BASE_EN = "http://127.0.0.1:8000/static/sd/"
SD_COMMENTS_BASE_FR = "http://127.0.0.1:8000/static/sd/"
SD_SUGGEST_A_DATASET_EN = "https://o127.0.0.1:8000/en/forms/suggest-dataset"
SD_SUGGEST_A_DATASET_FR = "https://127.0.0.1:8000/fr/formulaire/proposez-un-formulaire-densemble-de-donnees"
SD_VOTES_BASE_EN = "http://127.0.0.1:8000/static/sd/"
SD_VOTES_BASE_FR = "http://127.0.0.1:8000/static/sd/"

SD_RECORD_URL_EN = 'http://127.0.0.1:8000/en/sd/id/'
SD_RECORD_URL_FR = 'http://127.0.0.1:8000/fr/sd/id/'
SD_ALERT_EMAIL_FROM = ['My Name', 'my.email', 'my.domain.org']

# Used by the import_data_csv console command

IMPORT_DATA_CSV_DEFAULT_DEBUG = False
Expand Down
1 change: 0 additions & 1 deletion oc_search/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


urlpatterns = [
path('search/admin/', include('smuggler.urls')), # before admin url patterns!
path('search/admin/doc/', include('django.contrib.admindocs.urls')),
path('search/admin/', admin.site.urls),
]
Expand Down
47 changes: 21 additions & 26 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
Babel==2.16.0
bleach==6.2.0
celery==5.4.0
ckanapi==4.8
django==4.2.20
django-celery-beat==2.7.0
django-celery-results==2.5.1
django-cors-headers==4.6.0
django-jazzmin==3.0.1
django-qurl-templatetag==0.0.14
django-redis-sessions==0.6.2
django-smuggler==1.0.4
email-validator==2.2.0
inflection==0.5.1
markdown2==2.5.2
nltk==3.9
pandas==2.2.3
psycopg2==2.9.10
python-dateutil==2.9.0.post0
PyYAML==6.0.2
redis==5.2.1
setuptools>=75.8.0
termcolor==3.1.0
Unidecode==1.3.8
babel
bleach
ckanapi
django
django-celery-beat
django-celery-results
django-cors-headers
django-jazzmin
django-qurl-templatetag
django-redis-sessions
inflection
markdown2
nltk
numpy
psycopg2
pytz
PyYAML
redis
termcolor
Unidecode
uWSGI==2.0.28; sys_platform == 'linux'
#git+https://github.com/thriuin/SolrClient.git@master

#git+https://github.com/thriuin/SolrClient.git@master
4 changes: 0 additions & 4 deletions search/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SearchAdmin(admin.ModelAdmin):

change_list_template = 'smuggler/change_list.html'
list_display = ['search_id', 'label_en', 'solr_core_name']
fieldsets = (
(None, {'fields': ('search_id', 'solr_core_name', 'solr_default_op', 'solr_debugging', 'id_fields', 'alt_formats', 'label_en', 'label_fr',
Expand Down Expand Up @@ -69,7 +68,6 @@ def make_currency_field(modeladmn, request, queryset):

class FieldAdmin(admin.ModelAdmin):

change_list_template = 'smuggler/change_list.html'
list_display = ('field_id', 'is_search_facet', 'is_default_display', 'search_id', 'format_name', 'solr_field_is_coded', 'solr_field_type', 'solr_field_lang')
actions = [make_facet_field, make_default_display_field, clear_facet_field, clear_default_display_field, make_currency_field]
search_fields = ['field_id', 'is_search_facet']
Expand All @@ -87,7 +85,6 @@ class FieldAdmin(admin.ModelAdmin):

class CodeAdmin(admin.ModelAdmin):

change_list_template = 'smuggler/change_list.html'
list_display = ['code_id', 'field_fid', 'label_en', 'label_fr']
search_fields = ['code_id', 'label_en', 'label_fr']
list_filter = [('field_fid', admin.RelatedOnlyFieldListFilter)]
Expand All @@ -98,7 +95,6 @@ class CodeAdmin(admin.ModelAdmin):

class ChronologicCodesAdmin(admin.ModelAdmin):

change_list_template = 'smuggler/change_list.html'
list_display = ['label', 'codes', 'label_en', 'start_date', 'end_date']
search_fields = ['code_cid__code_id', 'label', 'label_en', 'label_fr']
list_filter = [('code_cid', admin.RelatedOnlyFieldListFilter)]
Expand Down