Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into release-2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
obdulia-losantos committed Oct 22, 2021
2 parents 57994bb + 1681d54 commit 2fe4eb7
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 31 deletions.
35 changes: 28 additions & 7 deletions aether-kernel/aether/kernel/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@
from .api import models

if settings.MULTITENANCY: # pragma: no cover
PROJECT_LIST_FILTER = ('mt__realm',)
CHILD_LIST_FILTER = ('project__mt__realm', 'project__active',)
ATTACH_LIST_FILTER = ('submission__project__mt__realm', 'submission__project__active',)
PROJECT_LIST_FILTER = (
('mt__realm', admin.EmptyFieldListFilter),
'mt__realm',
)
CHILD_LIST_FILTER = (
'project__active',
('project__mt__realm', admin.EmptyFieldListFilter),
'project__mt__realm',
)
ATTACH_LIST_FILTER = (
'submission__project__active',
('submission__project__mt__realm', admin.EmptyFieldListFilter),
'submission__project__mt__realm',
)

else: # pragma: no cover
PROJECT_LIST_FILTER = []
CHILD_LIST_FILTER = ('project__active',)
Expand All @@ -50,12 +62,12 @@ class MappingSetAdmin(BaseAdmin):


class MappingAdmin(BaseAdmin):
list_display = ('id', 'name', 'revision', 'mappingset',)
list_display = ('id', 'name', 'revision', 'mappingset', 'project',)
list_filter = ('is_active', 'is_read_only',) + CHILD_LIST_FILTER


class SubmissionAdmin(BaseAdmin):
list_display = ('id', 'mappingset', 'is_extracted',)
list_display = ('id', 'mappingset', 'is_extracted', 'project',)
list_filter = ('is_extracted',) + CHILD_LIST_FILTER


Expand All @@ -67,6 +79,7 @@ class AttachmentAdmin(BaseAdmin):

class SchemaAdmin(BaseAdmin):
list_display = ('id', 'name', 'family',)
list_filter = ('schemadecorators', admin.EmptyFieldListFilter),


class SchemaDecoratorAdmin(BaseAdmin):
Expand All @@ -76,8 +89,16 @@ class SchemaDecoratorAdmin(BaseAdmin):

class EntityAdmin(BaseAdmin):
date_hierarchy = 'created'
list_display = ('id', 'status', 'submission', 'mapping',)
list_filter = ('status',) + CHILD_LIST_FILTER
list_display = (
'id', 'status',
'submission', 'mapping',
'project', 'schema',
)
list_filter = (
'status',
('project', admin.EmptyFieldListFilter),
('schema', admin.EmptyFieldListFilter),
) + CHILD_LIST_FILTER


class ExportTaskAdmin(BaseAdmin):
Expand Down
6 changes: 3 additions & 3 deletions aether-kernel/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ asgiref==3.4.1
attrs==21.2.0
autopep8==1.5.7
avro-python3==1.10.2
boto3==1.18.65
botocore==1.21.65
boto3==1.19.1
botocore==1.22.1
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.7
Expand Down Expand Up @@ -76,7 +76,7 @@ openpyxl==3.0.9
packaging==21.0
ply==3.11
prometheus-client==0.11.0
protobuf==3.18.1
protobuf==3.19.0
psycopg2-binary==2.9.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
Expand Down
20 changes: 15 additions & 5 deletions aether-odk-module/aether/odk/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,19 @@
)

if settings.MULTITENANCY: # pragma: no cover
PROJECT_LIST_FILTER = ('mt__realm',)
XFORM_LIST_FILTER = ('project__mt__realm',)
MEDIAFILE_LIST_FILTER = ('xform__project__mt__realm',)
PROJECT_LIST_FILTER = (
('mt__realm', admin.EmptyFieldListFilter),
'mt__realm',
)
XFORM_LIST_FILTER = (
('project__mt__realm', admin.EmptyFieldListFilter),
'project__mt__realm',
)
MEDIAFILE_LIST_FILTER = (
('xform__project__mt__realm', admin.EmptyFieldListFilter),
'xform__project__mt__realm',
)

else: # pragma: no cover
PROJECT_LIST_FILTER = []
XFORM_LIST_FILTER = []
Expand Down Expand Up @@ -111,7 +121,7 @@ def propagate(self, request, queryset):
'version',
'active',
)
list_filter = ('active',) + XFORM_LIST_FILTER
list_filter = ('active', 'project__active',) + XFORM_LIST_FILTER
date_hierarchy = 'modified_at'
readonly_fields = (
'title', 'form_id', 'version', 'md5sum',
Expand Down Expand Up @@ -143,7 +153,7 @@ def propagate(self, request, queryset):
class MediaFileAdmin(BaseAdmin):

list_display = ('xform', 'name', 'md5sum', 'media_file',)
list_filter = MEDIAFILE_LIST_FILTER
list_filter = ('xform__active', 'xform__project__active',) + MEDIAFILE_LIST_FILTER
readonly_fields = ('md5sum',)
search_fields = ('xform', 'name',)
ordering = list_display
Expand Down
2 changes: 1 addition & 1 deletion aether-odk-module/conf/pip/primary-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ aether.sdk[cache,server,storage,test]
# xForm and data manipulation
lxml
python-dateutil
pyxform
pyxform # https://github.com/XLSForm/pyxform
spavro
13 changes: 4 additions & 9 deletions aether-odk-module/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
aether.sdk==1.4.0
asgiref==3.4.1
autopep8==1.5.7
boto3==1.18.65
botocore==1.21.65
boto3==1.19.1
botocore==1.22.1
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.7
Expand All @@ -38,7 +38,6 @@ djangorestframework==3.12.4
drf-dynamic-fields==0.3.1
flake8==4.0.1
flake8-quotes==3.3.1
FormEncode==1.3.1
funcy==1.16
google-api-core==2.1.1
google-auth==2.3.0
Expand All @@ -52,14 +51,13 @@ greenlet==1.1.2
idna==3.3
Jinja2==3.0.2
jmespath==0.10.0
linecache2==1.0.0
lxml==4.6.3
Markdown==3.3.4
MarkupSafe==2.0.1
mccabe==0.6.1
minio==6.0.2
prometheus-client==0.11.0
protobuf==3.18.1
protobuf==3.19.0
psycopg2-binary==2.9.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
Expand All @@ -69,7 +67,7 @@ Pygments==2.10.0
python-dateutil==2.8.2
python-json-logger==2.0.2
pytz==2021.3
pyxform==1.6.0
pyxform==1.7.0
redis==3.5.3
requests==2.26.0
rsa==4.7.2
Expand All @@ -81,9 +79,6 @@ SQLAlchemy==1.4.26
sqlparse==0.4.2
tblib==1.7.0
toml==0.10.2
traceback2==1.4.0
unicodecsv==0.14.1
unittest2==1.1.0
urllib3==1.26.7
uWSGI==2.0.20
xlrd==1.2.0
16 changes: 13 additions & 3 deletions aether-ui/aether/ui/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@
from .api import models, utils

if settings.MULTITENANCY: # pragma: no cover
PROJECT_LIST_FILTER = ('mt__realm',)
PIPELINE_LIST_FILTER = ('project__mt__realm',)
CONTRACT_LIST_FILTER = ('pipeline__project__mt__realm',)
PROJECT_LIST_FILTER = (
('mt__realm', admin.EmptyFieldListFilter),
'mt__realm',
)
PIPELINE_LIST_FILTER = (
('project__mt__realm', admin.EmptyFieldListFilter),
'project__mt__realm',
)
CONTRACT_LIST_FILTER = (
('pipeline__project__mt__realm', admin.EmptyFieldListFilter),
'pipeline__project__mt__realm',
)

else: # pragma: no cover
PROJECT_LIST_FILTER = []
PIPELINE_LIST_FILTER = []
Expand Down
6 changes: 3 additions & 3 deletions aether-ui/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
aether.sdk==1.4.0
asgiref==3.4.1
autopep8==1.5.7
boto3==1.18.65
botocore==1.21.65
boto3==1.19.1
botocore==1.22.1
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.7
Expand Down Expand Up @@ -58,7 +58,7 @@ MarkupSafe==2.0.1
mccabe==0.6.1
minio==6.0.2
prometheus-client==0.11.0
protobuf==3.18.1
protobuf==3.19.0
psycopg2-binary==2.9.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
Expand Down

0 comments on commit 2fe4eb7

Please sign in to comment.