Commit cb45b273 authored by Florent Chehab's avatar Florent Chehab

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):
def get_model_config(self, obj=None):
return self.Meta.model.model_config
FORCE_FULL_DISPLAY = False
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
else:
ct = ContentType.objects.get_for_model(self.Meta.model)
......
......@@ -40,6 +40,7 @@ class Scholarship(BasicModule):
class ScholarshipSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
def my_validate(self, attrs):
attrs = super(ScholarshipSerializer, self).my_validate(attrs)
......
......@@ -14,6 +14,7 @@ class TaggedItem(BasicModule):
class TaggedItemSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
def my_validate(self, attrs):
tagged_item_validation(attrs)
......
......@@ -15,6 +15,7 @@ class CountryDri(BasicModule):
class CountryDriSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
class Meta:
model = CountryDri
......
......@@ -15,6 +15,7 @@ class UniversityDri(BasicModule):
class UniversityDriSerializer(BasicModuleSerializer):
FORCE_FULL_DISPLAY = True
class Meta:
model = UniversityDri
......
......@@ -15,6 +15,7 @@ class UniversityScholarship(Scholarship):
class UniversityScholarshipSerializer(ScholarshipSerializer):
FORCE_FULL_DISPLAY = True
class Meta:
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