From e9fda70b4ac86badbd5297f857126121472b7ec6 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 15 Jan 2014 08:53:23 +0000 Subject: Nicer write_only fields implementation. Closes #1355 --- rest_framework/fields.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'rest_framework/fields.py') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 258c0f6a..2f475d6e 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -114,10 +114,6 @@ def strip_multiple_choice_msg(help_text): return help_text.replace(multiple_choice_msg, '') -class IgnoreFieldException(Exception): - pass - - class Field(object): read_only = True creation_counter = 0 @@ -329,7 +325,7 @@ class WritableField(Field): def field_to_native(self, obj, field_name): if self.write_only: - raise IgnoreFieldException() + return None return super(WritableField, self).field_to_native(obj, field_name) def field_from_native(self, data, files, field_name, into): -- cgit v1.2.3