Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Commit

Permalink
Added workaround for DRF issue that was causing item status to always…
Browse files Browse the repository at this point in the history
… get switched to reserved when moved via the api.
  • Loading branch information
melinath committed Oct 29, 2015
1 parent 5d07b99 commit 0434fa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions brambling/api/v1/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.core.urlresolvers import reverse
from django.utils import timezone
from rest_framework import serializers
from rest_framework.fields import empty

from brambling.models import (Order, EventHousing, BoughtItem,
EnvironmentalFactor, HousingCategory,
Expand Down Expand Up @@ -148,6 +149,8 @@ def __init__(self, *args, **kwargs):
if self.instance is not None:
# If this is not a creation, set various fields to read-only
self.fields['status'].read_only = True
# Workaround for https://github.com/tomchristie/django-rest-framework/issues/3565
self.fields['status'].default = empty
self.fields['order'].read_only = True
self.fields['item_option'].read_only = True

Expand Down

1 comment on commit 0434fa3

@melinath
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.