Merge remote-tracking branch 'origin/documentation'

This commit is contained in:
Alexander Wong 2018-01-21 16:02:22 -07:00
commit 6a8d50ceba
No known key found for this signature in database
GPG Key ID: EBFE6371FA6A79DC
3 changed files with 11 additions and 3 deletions

View File

@ -24,6 +24,11 @@ class WorkTypeSerializer(serializers.ModelSerializer):
validated_data['client'] = self.context['request'].user.client validated_data['client'] = self.context['request'].user.client
return serializers.ModelSerializer.create(self, validated_data) return serializers.ModelSerializer.create(self, validated_data)
def update(self, instance, validated_data):
if 'label' in validated_data:
raise serializers.ValidationError("Cannot update field.")
return super().update(instance, validated_data)
class PriceSerializer(serializers.ModelSerializer): class PriceSerializer(serializers.ModelSerializer):
get_employee_uuid = serializers.UUIDField(write_only=True) get_employee_uuid = serializers.UUIDField(write_only=True)
get_work_type_uuid = serializers.UUIDField(write_only=True) get_work_type_uuid = serializers.UUIDField(write_only=True)

View File

@ -88,7 +88,8 @@ class EmployerViewSet(viewsets.ModelViewSet):
http_method_names = ['get', 'head', 'put', 'options'] http_method_names = ['get', 'head', 'put', 'options']
def get_queryset(self): def get_queryset(self):
return Manage.objects.filter(provider__user__username=self.request.user) return Manage.objects.filter(provider__user__username=self.request.user) \
.filter(deleted=False)
class PriceViewSet(viewsets.ModelViewSet): class PriceViewSet(viewsets.ModelViewSet):
lookup_field = 'uuid' lookup_field = 'uuid'

View File

@ -82,6 +82,8 @@ REST_FRAMEWORK = {
CORS_ORIGIN_WHITELIST = ( CORS_ORIGIN_WHITELIST = (
'localhost:3000', 'localhost:3000',
'caremyway.ca',
'www.caremyway.ca',
) )
MIDDLEWARE = [ MIDDLEWARE = [