Skip to content

Update for DRF 3.0#16

Merged
lovelydinosaur merged 4 commits intoencode:masterfrom
carltongibson:update
Dec 15, 2014
Merged

Update for DRF 3.0#16
lovelydinosaur merged 4 commits intoencode:masterfrom
carltongibson:update

Conversation

@carltongibson
Copy link
Copy Markdown

@carltongibson
Copy link
Copy Markdown
Author

@tomchristie — This is almost working.

I have one issue with the IsOwnerOrReadOnly permission, which isn't immediately obvious to me: requesting the /snippets/ endpoint is resulting in a 500...

 AttributeError: 'Page' object has no attribute 'owner'

i.e. the permission class is not returning before the individual object check. In snippets/permissions.py I've assigned method = request.method which is 'POST' in the debugger. This doesn't make sense to me yet. If something occurs to you do say, otherwise I'll step through it more carefully later on.

Beyond that I just need to go over and remove any bits of old cruft. If anything jumps out to you let me know.

@lovelydinosaur
Copy link
Copy Markdown
Contributor

AttributeError: 'Page' object has no attribute 'owner'

Updating to 3.0.1 will resovle this.

@lovelydinosaur
Copy link
Copy Markdown
Contributor

(see encode/django-rest-framework#2205)

@carltongibson
Copy link
Copy Markdown
Author

Ah, that does fix it. :)

(Still not sure why request.method was reporting 'POST' there but that can wait for another day.)

Just pending your comments, if you have any.

Comment thread snippets/permissions.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Drop the whitespace (just include the final newline)

@lovelydinosaur
Copy link
Copy Markdown
Contributor

Coupla minor things, otherwise ready to go.

@carltongibson
Copy link
Copy Markdown
Author

Updated

@lovelydinosaur
Copy link
Copy Markdown
Contributor

Wonderful! :)

lovelydinosaur added a commit that referenced this pull request Dec 15, 2014
@lovelydinosaur lovelydinosaur merged commit 3e11f7a into encode:master Dec 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the tutorial repo for 3.0

2 participants