Skip to content

Commit e088efa

Browse files
committed
Clean up ValidationError error messages
1 parent d0effc1 commit e088efa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

push_notifications/api/rest_framework.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def to_internal_value(self, data):
2424
try:
2525
data = int(data, 16)
2626
except ValueError:
27-
raise ValidationError("ValidationError Device ID is not a valid hex number")
27+
raise ValidationError("Device ID is not a valid hex number")
2828
return super(HexIntegerField, self).to_internal_value(data)
2929

3030
def to_representation(self, value):
@@ -78,7 +78,7 @@ class Meta(DeviceSerializerMixin.Meta):
7878
def validate_device_id(self, value):
7979
# device ids are 64 bit unsigned values
8080
if value > UNSIGNED_64BIT_INT_MAX_VALUE:
81-
raise ValidationError("ValidationError Device ID is out of range")
81+
raise ValidationError("Device ID is out of range")
8282
return value
8383

8484

tests/mock_responses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
GCM_JSON_RESPONSE_ERROR_B = ('{"success":1, "failure": 2, "canonical_ids": 0, "cast_id": 6358665107659088804, '
1212
'"results": [{"error": "MismatchSenderId"}, {"message_id": '
1313
'"0:1433830664381654%3449593ff9fd7ecd"}, {"error": "InvalidRegistration"}]}')
14-
GCM_DRF_INVALID_HEX_ERROR = {'device_id': [u"ValidationError Device ID is not a valid hex number"]}
15-
GCM_DRF_OUT_OF_RANGE_ERROR = {'device_id': [u"ValidationError Device ID is out of range"]}
14+
GCM_DRF_INVALID_HEX_ERROR = {'device_id': [u"Device ID is not a valid hex number"]}
15+
GCM_DRF_OUT_OF_RANGE_ERROR = {'device_id': [u"Device ID is out of range"]}
1616
GCM_JSON_CANONICAL_ID_RESPONSE = '{"failure":0,"canonical_ids":1,"success":2,"multicast_id":7173139966327257000,"results":[{"registration_id":"NEW_REGISTRATION_ID","message_id":"0:1440068396670935%6868637df9fd7ecd"},{"message_id":"0:1440068396670937%6868637df9fd7ecd"}]}'
1717
GCM_JSON_CANONICAL_ID_SAME_DEVICE_RESPONSE = '{"failure":0,"canonical_ids":1,"success":2,"multicast_id":7173139966327257000,"results":[{"registration_id":"bar","message_id":"0:1440068396670935%6868637df9fd7ecd"},{"message_id":"0:1440068396670937%6868637df9fd7ecd"}]}'

0 commit comments

Comments
 (0)