Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies for Django 3.x upgrade #2230

Merged
merged 240 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
358d95d
Upgrade dependencies for Django 3.x upgrade
ukanga Apr 19, 2022
f0b9185
Update basestring references
ukanga Apr 19, 2022
d5506bc
Switch to using six instead of future
ukanga Apr 20, 2022
4f6ea56
django.utils.six - Remove usage of this vendored library or switch to…
ukanga Apr 20, 2022
c17da0c
Disable SPSS export in the event of an ImportError exception.
ukanga Apr 20, 2022
d6fd696
django.utils.decorators.available_attrs() - This function returns fun…
ukanga Apr 20, 2022
914f571
Disable SPSS export in the event of an ImportError exception.
ukanga Apr 20, 2022
2436bf4
Merge branch 'master' into django-3-upgrade-base
KipSigei Apr 24, 2022
49dea8c
Upgrade dependencies for Django 3.x upgrade
ukanga Apr 19, 2022
fed5113
Update basestring references
ukanga Apr 19, 2022
ba64380
Switch to using six instead of future
ukanga Apr 20, 2022
610c836
django.utils.six - Remove usage of this vendored library or switch to…
ukanga Apr 20, 2022
3576885
Disable SPSS export in the event of an ImportError exception.
ukanga Apr 20, 2022
4884d9d
django.utils.decorators.available_attrs() - This function returns fun…
ukanga Apr 20, 2022
4b0333e
Disable SPSS export in the event of an ImportError exception.
ukanga Apr 20, 2022
a8b83b9
Update requirements/base.pip
ukanga Apr 25, 2022
d04ebe9
Remove xlrd package in data_dictionary.py
ukanga Apr 25, 2022
3db7e19
Merge branch 'django-3-upgrade-base' of github.com:onaio/onadata into…
KipSigei Apr 25, 2022
0aa473b
Remove deprecated django.db.backends.postgresql_psycopg2
KipSigei Apr 25, 2022
cf42e8e
Fix dataview query_iterator bug
KipSigei Apr 25, 2022
cef1f01
Upgrade pyxform to version 1.10.0
ukanga Apr 25, 2022
02dd9c9
Remove deprecated django.contrib.postgres.fields.JSONField
KipSigei Apr 25, 2022
deefb2d
Remove deprecated python_2_unicode_compatible decorator
KipSigei Apr 25, 2022
aa5969f
Squash logger application migrations
DavisRayM Apr 25, 2022
562a507
Alter JSON column field types to use `django.db.models.JSONField`
DavisRayM Apr 25, 2022
ea08db0
Use `JSONField` field type instead of `TextField` on the XForm model
DavisRayM Apr 25, 2022
ad3fe9c
Add DEFAULT_AUTO_FIELD
KipSigei Apr 25, 2022
9dc886c
Merge branch 'django-3-upgrade-base' of github.com:onaio/onadata into…
KipSigei Apr 25, 2022
a96f8a2
Transition to using the squashed migration
DavisRayM Apr 25, 2022
0ff25ea
Update migrations files to depend on the squashed migration
DavisRayM Apr 25, 2022
5430b46
Restore old logger application migration files
DavisRayM Apr 25, 2022
e756f4c
Revert dependency changes to use 0001_initial
DavisRayM Apr 25, 2022
1d4090d
Add back `replaces` attribute
DavisRayM Apr 25, 2022
c8ee2b3
Squash viewer app migrations
DavisRayM Apr 25, 2022
31b7557
Install `jsonfield` package; Allows migrations to run on the CI
DavisRayM Apr 25, 2022
da3c3b3
Merge pull request #2232 from onaio/fix-ci-tests-failures
DavisRayM Apr 25, 2022
6a0e6d9
Alter media_all_received col to use BooleanField
KipSigei Apr 25, 2022
c4f2c9f
Fix failing `query_data` test
DavisRayM Apr 25, 2022
e62a8fa
Fix cursor.fetchall() returning stringofied dicts
KipSigei Apr 25, 2022
238335a
remove jsonfield import from migrations
ukanga Apr 26, 2022
f3bae6a
Fix regressions
KipSigei Apr 26, 2022
934c414
Update apps/api & apps/main modules
KipSigei Apr 26, 2022
db12a0f
Add tblib dependency to pickle tracebacks
KipSigei Apr 26, 2022
dd6f831
Json load cursor dicts
KipSigei Apr 26, 2022
18cc28c
Handle non existent exports
KipSigei Apr 26, 2022
a8eaf91
use setup-python@v3 on CI
KipSigei Apr 27, 2022
9e73e2a
update CI python version to 3.9
KipSigei Apr 27, 2022
c3d754b
jsonfield in CI not required
ukanga Apr 27, 2022
c852876
Skip savReaderWriter tests
ukanga Apr 27, 2022
a8df483
Handle "Attribute etag_hash defined outside __init__"
ukanga Apr 27, 2022
9587635
Cleanup onadata/settings module
ukanga Apr 27, 2022
752fdb3
Cleanup
ukanga Apr 27, 2022
8f11a51
Add lxml apt deps to CI
KipSigei Apr 28, 2022
23e3d89
Cleanup
KipSigei Apr 28, 2022
1d3f363
Fix deformed f-strings
KipSigei Apr 28, 2022
69621ca
Upgrade to django 3 on ses & s3 requirements
KipSigei Apr 28, 2022
93102a4
covert survey to json string
KipSigei Apr 28, 2022
323bb63
covert survey to json string
KipSigei Apr 28, 2022
c741170
Update OSM XML, order changed.
ukanga Apr 28, 2022
9a9314b
Use builder.create_survey_element_from_(dict|json) accordingly.
ukanga Apr 29, 2022
879240d
Cleanup
ukanga Apr 29, 2022
1f4bc19
Cleanup
ukanga Apr 29, 2022
e025903
Fix f-string syntax
ukanga Apr 29, 2022
6b0280f
Fix project caching clearing
ukanga Apr 29, 2022
30f960e
Fix test check string
ukanga Apr 29, 2022
10e7261
Fix generate_qrcode: Rename format to image_format
ukanga Apr 29, 2022
6239e30
Cleanup
ukanga Apr 29, 2022
2996b71
Cleanup
ukanga Apr 29, 2022
b6cdd80
Skip SPSS tests
ukanga Apr 29, 2022
3162a37
briefcase_viewset.py: cleanup
ukanga Apr 29, 2022
578d110
renderers.py: cleanup
ukanga Apr 29, 2022
8add763
filters.py: cleanup
ukanga Apr 29, 2022
68926e7
batch: cleanup
ukanga Apr 29, 2022
6e11628
batch: cleanup
ukanga Apr 29, 2022
6ae9c95
Indicate md5 use in gravatar is not used for security'
ukanga Apr 29, 2022
87130f7
Use requests library since urllib.urlopen is blacklisted
ukanga Apr 29, 2022
7b22805
cleanup
ukanga Apr 29, 2022
6727768
cleanup
ukanga Apr 29, 2022
1120ec4
Fix xform_tags_add imports
ukanga Apr 29, 2022
8c61312
Update deformed f-strings
KipSigei Apr 29, 2022
640bc52
batch: cleanup
ukanga Apr 29, 2022
50baa77
batch: cleanup
ukanga May 1, 2022
4bf0ac4
batch: cleanup
ukanga May 1, 2022
08a2ff5
batch: cleanup
ukanga May 1, 2022
b65f088
Fix: handle KeyError exception
ukanga May 1, 2022
2ce81f7
batch: cleanup
ukanga May 1, 2022
010c503
batch: cleanup
ukanga May 2, 2022
2ec3ea1
batch: cleanup
ukanga May 2, 2022
a519c20
batch: cleanup
ukanga May 2, 2022
41fbfac
Fix missing f-string format
ukanga May 2, 2022
0b7b1c7
flake8 fixes
ukanga May 2, 2022
bd9c41a
batch: cleanup
ukanga May 2, 2022
2eb4e70
Fix: handle DataError exceptions
ukanga May 2, 2022
0a4e075
assertEquals is deprecated
ukanga May 2, 2022
c558ced
batch: cleanup
ukanga May 2, 2022
039ab1a
batch: cleanup
ukanga May 2, 2022
011bd69
batch: cleanup
ukanga May 2, 2022
122b72f
batch: cleanup
ukanga May 2, 2022
20f1d3b
batch: cleanup
ukanga May 2, 2022
2d22c6b
Fixes
ukanga May 2, 2022
ebbe267
onadata.libs.utils.audit is not in use
ukanga May 2, 2022
a8cc0d5
batch: cleanup
ukanga May 2, 2022
a4268a0
export_builder.py: cleanup
ukanga May 2, 2022
ebde8e2
Fix: mock the builtin ConnectionError for connection_error test
ukanga May 2, 2022
b654103
fix: 'ExportBuilder' object has no attribute 'dd'
ukanga May 2, 2022
eb277bc
batch: cleanup
ukanga May 3, 2022
a471fee
Fix: urlopen tests to use requests mocked response.
ukanga May 3, 2022
5fc0e66
Fixes: urlopen removal in test and setting xform.sms_id_string
ukanga May 3, 2022
60bb1fe
Remove unused import of requests
ukanga May 4, 2022
fcff196
Handle stringified dicts
KipSigei May 4, 2022
b5dc8de
Use create_survey_element_from_(json|dict) where necessary
KipSigei May 4, 2022
51f6a9c
Build onadata ECR image with python 3.9
KipSigei May 4, 2022
7959c5f
Use python3-dev apt dependency
KipSigei May 4, 2022
47d335d
Instal pyyaml in docker builds
KipSigei May 4, 2022
a4faaef
main.views: cleanup
ukanga May 4, 2022
2e12885
main.views: cleanup fixes
ukanga May 4, 2022
52e5a66
Add some debug statements in CI only failing test.
ukanga May 4, 2022
9ac1b14
Use defusedxml for parsing xml in osm module
ukanga May 4, 2022
68a40b3
Add some debug statements in CI only failing test.
ukanga May 4, 2022
d096758
Import etree via defusedxml module
ukanga May 4, 2022
d14cfa7
batch: cleanup
ukanga May 4, 2022
12a5ba1
Use defusedxml tostring import
ukanga May 4, 2022
a8110c4
user_profile_viewset.py: cleanup
ukanga May 4, 2022
5af578e
Add some debug statements in CI only failing test.
ukanga May 4, 2022
df87d54
batch: cleanup
ukanga May 5, 2022
bce53e2
Merge branch 'master' into django-3-upgrade-base
ukanga May 5, 2022
3124819
batch: cleanup
ukanga May 5, 2022
d75de96
Dependecies cleanup
KipSigei May 5, 2022
fadc3d3
Remove local path to onadata repository
DavisRayM May 5, 2022
43464c9
Use python3.9 instead of in-built python3 installation
DavisRayM May 5, 2022
9075e79
Deprecation: staticfiles has been renamed to static
KipSigei May 5, 2022
c780e1e
Fix: [200~UnboundLocalError: local variable response_obj referenced …
ukanga May 5, 2022
d7233a4
Used 'django-upgrade --target-version 3.2'
ukanga May 5, 2022
61da20e
Add prospector configuration file.
ukanga May 5, 2022
dbcf980
stats_serializer.py: cleanup
ukanga May 5, 2022
8264a1a
Fix flake8 issues.
ukanga May 5, 2022
e3c2a03
Update test to set HTTP_ prefix header correctly for Django 3
ukanga May 5, 2022
1832370
stats_serializer.py: fix super(serializers.Serializer, self) call
ukanga May 5, 2022
b6ac782
import_briefcase.py: cleanup
ukanga May 5, 2022
736a497
xform_viewset.py: cleanup
ukanga May 5, 2022
6ee49f3
Update test to set HTTP_ prefix header correctly for Django 3
ukanga May 5, 2022
dda1994
import.py: cleanup
ukanga May 5, 2022
34396c3
logger/views.py: cleanup
ukanga May 5, 2022
35c4a1b
exceptions.py: cleanup
ukanga May 5, 2022
a59cece
set_media_file_hash.py: cleanup
ukanga May 5, 2022
0bef078
Check for None in overwrite params
ukanga May 5, 2022
51a7de5
create_image_thumbnails.py: cleanup
ukanga May 6, 2022
660f962
admin.py: cleanup
ukanga May 6, 2022
f76fab4
viewer/views.py: cleanup
ukanga May 7, 2022
b4af3d9
restore_backup.py: cleanup
ukanga May 7, 2022
891fc51
project_serializer.py: cleanup
ukanga May 7, 2022
60a7793
parsed_instance.py: cleanup
ukanga May 7, 2022
9b7094b
xform_serializer.p: cleanup
ukanga May 7, 2022
55e9b66
user_profile_serializer.py: cleanup
ukanga May 7, 2022
4121813
organization_serializer.py: cleanup
ukanga May 7, 2022
c1c7ba1
chart_tools.py: cleanup
ukanga May 7, 2022
25cfa6a
signals.py: cleanup
ukanga May 7, 2022
eed0184
change_s3_media_permissions.py: cleanup
ukanga May 7, 2022
9f48aed
export_xforms_and_instances.py: cleanup
ukanga May 7, 2022
e7aa703
update_enketo_urls.py: cleanup
ukanga May 7, 2022
6ea1e04
update_enketo_urls.py: cleanup
ukanga May 7, 2022
8738fa3
main/urls.py: cleanup
ukanga May 7, 2022
f983aa4
viewer_tools.py: use defusedxml.minidom
ukanga May 7, 2022
a8fb5a0
xform_viewset.py: cleanup
ukanga May 7, 2022
4780e46
labels_mixin.py: cleanup
ukanga May 7, 2022
8835c1b
tools.py: cleanup
ukanga May 7, 2022
7dba4ea
move_media_to_s3.py: cleanup
ukanga May 7, 2022
2fcd1b4
filters.py: cleanup
ukanga May 7, 2022
1423333
populate_osmdata_model.py: cleanup
ukanga May 7, 2022
2504e59
osmdata.py: cleanup
ukanga May 7, 2022
ad9b1ea
tag_list_serializer.py: cleanup
ukanga May 7, 2022
1a936f5
share_team_project_serializer.py: cleanup
ukanga May 7, 2022
6be367f
fix: check if overwrite is a str
ukanga May 7, 2022
e2c71c5
batch: cleanup
ukanga May 7, 2022
ac0f60c
user_auth.py: cleanup
ukanga May 7, 2022
7c56e9e
main.views: cleanup fixes
ukanga May 7, 2022
83be5f1
get_accounts_with_duplicate_id_strings.py: cleanup
ukanga May 7, 2022
cb83775
batch: cleanup
ukanga May 7, 2022
1f04916
Refactor create_attachments_zipfile()
ukanga May 7, 2022
7ca8fe1
twilio.py: cleanup
ukanga May 7, 2022
6aaccba
telerivet.py: cleanup
ukanga May 7, 2022
0a7faae
smssync.py: cleanup
ukanga May 7, 2022
f956848
sms_support.providers: cleanup
ukanga May 7, 2022
11ba38c
batch: cleanup
ukanga May 7, 2022
9ff759b
batch: cleanup
ukanga May 7, 2022
b59e5de
project_cleanup.py: cleanup
ukanga May 8, 2022
a3fbf7f
factory.py: cleanup
ukanga May 8, 2022
090feb6
share_xform.py: cleanup
ukanga May 8, 2022
009b5cc
share_team_project.py: cleanup
ukanga May 8, 2022
e81c196
import_forms.py: cleanup
ukanga May 8, 2022
0dff8cb
reassign_permission.py: cleanup
ukanga May 8, 2022
d269018
share_project.py: cleanup
ukanga May 8, 2022
0cf040f
merged_xform.py: cleanup
ukanga May 8, 2022
cbd3390
clone_xform.py: cleanup
ukanga May 8, 2022
941d291
share_xform_serializer.py: cleanup
ukanga May 8, 2022
990e8a4
Duplicate command.
ukanga May 8, 2022
1f40551
__init__.py cleanup
ukanga May 8, 2022
c87a51b
__init__.py cleanup
ukanga May 8, 2022
3ffa281
signal.py: Check ASYNC_POST_SUBMISSION_PROCESSING_ENABLED
ukanga May 10, 2022
b0d9186
csv_import.py: Check if xform.json is a dict
ukanga May 10, 2022
5ed6b01
restservice: cleanup
ukanga May 10, 2022
793769b
Check if xform.json is a dict
ukanga May 11, 2022
1dbbeca
Check for None value in textit rest service configuration
ukanga May 11, 2022
9c06267
fixes: Check if xform.json is a dict
ukanga May 11, 2022
22a40a1
sms_support: cleanup
ukanga May 11, 2022
4e6093b
logger_tools.py: cleanup
ukanga May 11, 2022
e7f6882
logger_tools.py: Fix check for request.
ukanga May 11, 2022
4a2fa71
logger_tools.py: Fix add DuplicateUUIDError exception for handling in…
ukanga May 11, 2022
3ee8df8
apps/logger blackify
ukanga May 9, 2022
76829bc
logger: cleanup
ukanga May 12, 2022
efdc717
logger: cleanup
ukanga May 12, 2022
8b54914
import_tools.py: handle silently Http404 exception
ukanga May 12, 2022
5445c54
Add `google-auth-oauthlib` requirement
DavisRayM May 6, 2022
985f146
Use Flow class from `google_auth_oauthlib`
DavisRayM May 6, 2022
6bc459c
Disable credential storage and utilize `create_flow` function
DavisRayM May 6, 2022
25424c0
Add `google-auth` requirement
DavisRayM May 6, 2022
f9d314c
Add `CredentialsField` class
DavisRayM May 6, 2022
b7884b7
Remove unsupported `prompt` keyword arguement
DavisRayM May 9, 2022
f414cce
Remove local directory path
DavisRayM May 9, 2022
6fc11cd
Remove oauth2client requirement
DavisRayM May 9, 2022
524a576
Update `from_db_value` function signature
DavisRayM May 9, 2022
4f01f78
Use correct scopes when creating flow object
DavisRayM May 9, 2022
4b0543c
Handle storage and retrieval of OAuth2 credentials
DavisRayM May 9, 2022
de25395
Use internal `CredentialsField` class
DavisRayM May 9, 2022
18d3a0c
Implement authorization URL best practices
DavisRayM May 9, 2022
a3583dd
Ensure credential is returned if present
DavisRayM May 10, 2022
3f8ffb4
Code cleanup
DavisRayM May 10, 2022
6a0927a
Format code
DavisRayM May 10, 2022
c74304b
Prompt for consent everytime we authenticate with google
DavisRayM May 11, 2022
18ba766
Add migration to convert oauth2client.Credentials class
DavisRayM May 13, 2022
97c2d1c
Create credentials using access token when present
DavisRayM May 13, 2022
c6d7c01
Google: cleanup
ukanga May 13, 2022
c056ee0
cleanup
ukanga May 14, 2022
89503b1
cleanup
ukanga May 14, 2022
1cdc204
Allow geojson file uploads
FrankApiyo May 17, 2022
c868d6f
Merge pull request #2237 from onaio/allow-geojson-file-uploads
FrankApiyo May 17, 2022
0339ebc
Bump version to 3.0.0
KipSigei May 18, 2022
ac21106
Move test deps to tests_require
KipSigei May 18, 2022
75fae72
Compare with lowercase export_type
ukanga May 19, 2022
fdb0fcb
Set version in __init__.py
ukanga May 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ max-line-length = 88
...
select = C,E,F,W,B,B950
extend-ignore = E203, E501
per-file-ignores = __init__.py:F401
15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

7 changes: 4 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

### Side effects of implementing this change

### Before submitting this PR for review, please make sure you have:

- [ ] Included tests
- [ ] Updated documentation
**Before submitting this PR for review, please make sure you have:**

- [ ] Included tests
- [ ] Updated documentation

Closes #
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
distribution: "adopt"
java-version: "8"

- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.8
architecture: 'x64'
python-version: 3.9
architecture: "x64"

- name: Get pip cache dir
id: pip-cache
Expand All @@ -61,14 +61,15 @@ jobs:
- name: Install APT requirements
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev
sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
sudo rm -rf /var/lib/apt/lists/*

- name: Install Pip requirements
run: |
pip install -U pip
pip install -r requirements/base.pip
pip install flake8
pip install tblib

- name: Run tests
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ tags

.bash_history
.inputrc

.eggs
sonar-project.properties
.scannerwork
6 changes: 6 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
strictness: medium
doc-warnings: false
test-warnings: false
autodetect: true
member-warnings: false
max-line-length: 88
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,too-few-public-methods

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
30 changes: 15 additions & 15 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ The following is a set of guidelines for contributing to Ona Data. Following the

In case you have encountered any issue within the project, please make sure:

- You are using the [latest release](http://github.com/onaio/onadata/releases).
- You have setup the project according to the [Installation Documentation](https://api.ona.io/static/docs/install.html).
- You are using the [latest release](http://github.com/onaio/onadata/releases).
- You have setup the project according to the [Installation Documentation](https://api.ona.io/static/docs/install.html).

After confirming the above, make sure the issue has not been reported on our [issues page](https://github.com/onaio/onadata/issues). If it hasn't been reported, [open a ticket](https://github.com/onaio/onadata/issues/new) containing:

- Information about your system environment (Operating System, local settings, etc.).
- What you expected to happen, and what actually happened.
- Out of place / weird logs and any other interesting information
- All steps to reproduce the issue.
- Information about your system environment (Operating System, local settings, etc.).
- What you expected to happen, and what actually happened.
- Out of place / weird logs and any other interesting information
- All steps to reproduce the issue.

### 2. Suggest Enhancements or New Features ⚡

Feature and enhancement requests are always welcome! We ask you ensure the following details are provided while [opening a ticket](https://github.com/onaio/onadata/issues/new), in order to start a constructive discussion:

- Describe the feature/enhancement in detail.
- Explain why the feature/enhancement is needed.
- Describe how the feature/enhancement should work
- List any advantages & disadvantages of implementing the feature/enhancement
- Describe the feature/enhancement in detail.
- Explain why the feature/enhancement is needed.
- Describe how the feature/enhancement should work
- List any advantages & disadvantages of implementing the feature/enhancement

### 3. Code contributions / Pull requests 💻

Pull requests are wholeheartedly welcome!❤️ If you are unsure about how to make your first pull request, here are some helpful resources:

- [Creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
- [How to create effective pull requests](https://dev.to/mpermar/how-to-create-effective-pull-requests-2m8e)
- [Creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
- [How to create effective pull requests](https://dev.to/mpermar/how-to-create-effective-pull-requests-2m8e)

In order to make it easier for us to facilitate the smooth merging of your pull request, please make sure the following standards are met within your pull request.

- Ensure your git commits are signed. _Read about signing commits [here](https://help.github.com/en/github/authenticating-to-github/signing-commits)_
- Code & commits follow our [styleguides](#Styleguides).
- Implement / Update tests that need to be updated and ensure that they pass. _Running all the tests within this project may be tough and time consuming. But not to worry! On submission of the pull request, [Travis CI](https://travis-ci.org/) will run all the tests across our modules_.
- Ensure your git commits are signed. _Read about signing commits [here](https://help.github.com/en/github/authenticating-to-github/signing-commits)_
- Code & commits follow our [styleguides](#Styleguides).
- Implement / Update tests that need to be updated and ensure that they pass. _Running all the tests within this project may be tough and time consuming. But not to worry! On submission of the pull request, [Travis CI](https://travis-ci.org/) will run all the tests across our modules_.

With the above points in mind feel free to comment on one of our [beginner-friendly issues](https://github.com/onaio/onadata/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+First+Issue%22) expressing your intent to work on it.

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
db:
image: postgis/postgis:9.6-3.0
image: postgis/postgis:13-3.0
environment:
- POSTGRES_PASSWORD=onadata
- POSTGRES_USER=onadata
Expand All @@ -29,7 +29,7 @@ services:
- db
- queue
environment:
- SELECTED_PYTHON=python3.6
- SELECTED_PYTHON=python3.9
- INITDB=false
notifications:
image: emqx/emqx:4.3.2
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [ ${INITDB} ]; then
if [ "${INITDB}" ]; then
RUN_DB_INIT_SCRIPT=$INITDB
else
RUN_DB_INIT_SCRIPT=true
Expand All @@ -13,8 +13,8 @@ if $RUN_DB_INIT_SCRIPT; then
psql -h db -U postgres onadata -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;"
fi

virtualenv -p `which $SELECTED_PYTHON` /srv/onadata/.virtualenv/${SELECTED_PYTHON}
. /srv/onadata/.virtualenv/${SELECTED_PYTHON}/bin/activate
virtualenv -p "$(which "${SELECTED_PYTHON}")" "/srv/onadata/.virtualenv/${SELECTED_PYTHON}"
. /srv/onadata/.virtualenv/"${SELECTED_PYTHON}"/bin/activate

cd /srv/onadata
pip install --upgrade pip
Expand Down
19 changes: 10 additions & 9 deletions docker/onadata-uwsgi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8 as intermediate
FROM python:3.9 as intermediate

ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
Expand All @@ -14,7 +14,7 @@ RUN mkdir -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN --mount=type=ssh if [ -n "$optional_packages" ]; then pip install ${optional_packages} ; fi

FROM ubuntu:20.04
COPY --from=intermediate /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/dist-packages/
COPY --from=intermediate /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/dist-packages/

ARG release_version=v2.4.1

Expand All @@ -35,8 +35,8 @@ RUN apt-get update -q &&\
libmemcached-dev \
build-essential \
supervisor \
python3.8 \
python3.8-dev \
python3.9 \
python3-dev \
python3-pip \
python3-setuptools \
git \
Expand All @@ -47,6 +47,7 @@ RUN apt-get update -q &&\
libjpeg-dev \
libxml2-dev \
libxslt1-dev \
libpython3.9-dev \
zlib1g-dev \
ghostscript \
python3-celery \
Expand Down Expand Up @@ -79,11 +80,11 @@ COPY uwsgi.ini /uwsgi.ini
# Install service requirements
WORKDIR /srv/onadata
# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir -U pip && \
python3 -m pip install --no-cache-dir -r requirements/base.pip && \
python3 -m pip install --no-cache-dir -r requirements/s3.pip && \
python3 -m pip install --no-cache-dir -r requirements/ses.pip && \
python3 -m pip install --no-cache-dir uwsgitop django-prometheus==v2.2.0
RUN python3.9 -m pip install --no-cache-dir -U pip && \
python3.9 -m pip install --no-cache-dir -r requirements/base.pip && \
python3.9 -m pip install --no-cache-dir -r requirements/s3.pip && \
python3.9 -m pip install --no-cache-dir -r requirements/ses.pip && \
python3.9 -m pip install --no-cache-dir pyyaml uwsgitop django-prometheus==v2.2.0

# Compile API Docs
RUN make -C docs html
Expand Down
2 changes: 1 addition & 1 deletion docker/onadata-uwsgi/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
db:
image: postgis/postgis:9.6-3.0
image: postgis/postgis:13-3.0
environment:
- POSTGRES_PASSWORD=onadata
- POSTGRES_USER=onadata
Expand Down
9 changes: 4 additions & 5 deletions docker/postgis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM postgres:9.6

MAINTAINER Ukang'a Dickson <[email protected]>


RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y postgresql-9.6-postgis-2.3 \
postgresql-9.6-postgis-script postgis \
apt-get install --no-install-recommends -y \
postgresql-9.6-postgis-2.3=2.3.1+dfsg-2+deb9u2 \
postgresql-9.6-postgis-2.3-scripts=2.3.1+dfsg-2+deb9u2 \
postgis=2.3.1+dfsg-2+deb9u2 \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["docker-entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion onadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
from __future__ import absolute_import, unicode_literals

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might not need the __future__ import

__version__ = "2.5.20"
__version__ = "3.0.0"


# This will make sure the app is always imported when
Expand Down
35 changes: 17 additions & 18 deletions onadata/apps/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# -*- coding: utf-8 -*-
"""API Django admin amendments."""
from django.contrib import admin

from onadata.apps.api.models import Team, OrganizationProfile, TempToken


class TeamAdmin(admin.ModelAdmin):
# pylint: disable=too-few-public-methods
class FilterSuperuserMixin:
"""Filter by request user and give full access to superuser."""

def get_queryset(self, request):
qs = super(TeamAdmin, self).get_queryset(request)
"""Filter by request.user unless is_superuser."""
queryset = super().get_queryset(request)
if request.user.is_superuser:
return qs
return qs.filter(user=request.user)
return queryset
return queryset.filter(user=request.user)


admin.site.register(Team, TeamAdmin)
class TeamAdmin(FilterSuperuserMixin, admin.ModelAdmin):
"""Filter by request.user unless is_superuser."""


class OrganizationProfileAdmin(admin.ModelAdmin):
admin.site.register(Team, TeamAdmin)

def get_queryset(self, request):
qs = super(OrganizationProfileAdmin, self).get_queryset(request)
if request.user.is_superuser:
return qs
return qs.filter(user=request.user)

class OrganizationProfileAdmin(FilterSuperuserMixin, admin.ModelAdmin):
"""Filter by request.user unless is_superuser."""

admin.site.register(OrganizationProfile, OrganizationProfileAdmin)

admin.site.register(OrganizationProfile, OrganizationProfileAdmin)

class TempTokenProfileAdmin(admin.ModelAdmin):

def get_queryset(self, request):
qs = super(TempTokenProfileAdmin, self).get_queryset(request)
if request.user.is_superuser:
return qs
return qs.filter(user=request.user)
class TempTokenProfileAdmin(FilterSuperuserMixin, admin.ModelAdmin):
"""Filter by request.user unless is_superuser."""


admin.site.register(TempToken, TempTokenProfileAdmin)
Loading