Fix wrong role points output.
parent
de95fb2a91
commit
fa2864ba19
|
@ -25,6 +25,7 @@ class UserStoryInline(admin.TabularInline):
|
||||||
class RolePointsInline(admin.TabularInline):
|
class RolePointsInline(admin.TabularInline):
|
||||||
model = models.RolePoints
|
model = models.RolePoints
|
||||||
sortable_field_name = 'role'
|
sortable_field_name = 'role'
|
||||||
|
readonly_fields = ["id"]
|
||||||
extra = 0
|
extra = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ from . import models
|
||||||
|
|
||||||
class RolePointsField(serializers.WritableField):
|
class RolePointsField(serializers.WritableField):
|
||||||
def to_native(self, obj):
|
def to_native(self, obj):
|
||||||
return {str(o.role.id): o.points.order for o in obj.all()}
|
return {str(o.role.id): o.points.id for o in obj.all()}
|
||||||
|
|
||||||
def from_native(self, obj):
|
def from_native(self, obj):
|
||||||
if isinstance(obj, dict):
|
if isinstance(obj, dict):
|
||||||
|
|
Loading…
Reference in New Issue