diff --git a/api_volontaria/apps/user/tests/test_view_users.py b/api_volontaria/apps/user/tests/test_view_users.py index 46fcabbd..21759a14 100644 --- a/api_volontaria/apps/user/tests/test_view_users.py +++ b/api_volontaria/apps/user/tests/test_view_users.py @@ -69,6 +69,7 @@ def test_profile(self): 'event': { 'create': False, 'update': False, + 'read': True, 'destroy': False, }, 'participation': { diff --git a/api_volontaria/apps/volunteer/admin.py b/api_volontaria/apps/volunteer/admin.py index c4e2d7c3..15272ea4 100644 --- a/api_volontaria/apps/volunteer/admin.py +++ b/api_volontaria/apps/volunteer/admin.py @@ -111,6 +111,12 @@ class EventAdmin(admin.ModelAdmin): date_hierarchy = 'start_time' ordering = ('start_time',) + search_fields = [ + 'description', 'start_time', + 'cell__name', + 'task_type__name', + ] + @staticmethod def status_volunteers(obj): return str(obj.nb_volunteers) + ' / ' + \ diff --git a/api_volontaria/apps/volunteer/models.py b/api_volontaria/apps/volunteer/models.py index 24118bdb..11715bd6 100644 --- a/api_volontaria/apps/volunteer/models.py +++ b/api_volontaria/apps/volunteer/models.py @@ -205,6 +205,12 @@ class Meta: on_delete=models.PROTECT, ) + search_fields = ['description', + 'start_time', + 'cell__name', + 'task_type__name', + ] + def __str__(self): return str(self.start_time) + ' - ' + str(self.end_time) @@ -238,6 +244,14 @@ def duration(self): def has_list_permission(request): return True + @staticmethod + def has_read_permission(request): + return True + + @staticmethod + def has_object_read_permission(request): + return True + @staticmethod @authenticated_users def has_create_permission(request): diff --git a/requirements.txt b/requirements.txt index 15637543..65777321 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ jsonfield==3.1.0 django-model-utils==4.0.0 babel==2.8.0 django-import-export==2.0.2 -django-money==1.1 +django-money==2.0.1 # Documentation tools mkdocs==1.1.2