Commit cb45b273 authored by Florent Chehab's avatar Florent Chehab
Browse files

Update backend : added FORCE_FULL_DISPLAY in serializer to return pending...

Update backend : added FORCE_FULL_DISPLAY in serializer to return pending moderation elements as they are needed for the frontent in group view
parent d4e941e5
...@@ -41,8 +41,10 @@ class MyModelSerializer(MySerializerWithJSON): ...@@ -41,8 +41,10 @@ class MyModelSerializer(MySerializerWithJSON):
def get_model_config(self, obj=None): def get_model_config(self, obj=None):
return self.Meta.model.model_config return self.Meta.model.model_config
FORCE_FULL_DISPLAY = False
def get_pending_moderation(self, obj): def get_pending_moderation(self, obj):
if self.context['view'].action == 'list': if not self.FORCE_FULL_DISPLAY and self.context['view'].action == 'list':
return None return None
else: else:
ct = ContentType.objects.get_for_model(self.Meta.model) ct = ContentType.objects.get_for_model(self.Meta.model)
......
...@@ -40,6 +40,7 @@ class Scholarship(BasicModule): ...@@ -40,6 +40,7 @@ class Scholarship(BasicModule):
class ScholarshipSerializer(BasicModuleSerializer): class ScholarshipSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
def my_validate(self, attrs): def my_validate(self, attrs):
attrs = super(ScholarshipSerializer, self).my_validate(attrs) attrs = super(ScholarshipSerializer, self).my_validate(attrs)
......
...@@ -14,6 +14,7 @@ class TaggedItem(BasicModule): ...@@ -14,6 +14,7 @@ class TaggedItem(BasicModule):
class TaggedItemSerializer(BasicModuleSerializer): class TaggedItemSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
def my_validate(self, attrs): def my_validate(self, attrs):
tagged_item_validation(attrs) tagged_item_validation(attrs)
......
...@@ -15,6 +15,7 @@ class CountryDri(BasicModule): ...@@ -15,6 +15,7 @@ class CountryDri(BasicModule):
class CountryDriSerializer(BasicModuleSerializer): class CountryDriSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
class Meta: class Meta:
model = CountryDri model = CountryDri
......
...@@ -15,6 +15,7 @@ class UniversityDri(BasicModule): ...@@ -15,6 +15,7 @@ class UniversityDri(BasicModule):
class UniversityDriSerializer(BasicModuleSerializer): class UniversityDriSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
class Meta: class Meta:
model = UniversityDri model = UniversityDri
......
...@@ -15,6 +15,7 @@ class UniversityScholarship(Scholarship): ...@@ -15,6 +15,7 @@ class UniversityScholarship(Scholarship):
class UniversityScholarshipSerializer(ScholarshipSerializer): class UniversityScholarshipSerializer(ScholarshipSerializer):
FORCE_FULL_DISPLAY = True
class Meta: class Meta:
model = UniversityScholarship model = UniversityScholarship
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment