Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlo91 committed May 25, 2023
1 parent 7906cf1 commit faab97e
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,26 @@ If you already ran the "makemigrations" for core_user, simply run `python mana
For more details check out this <a href="https://github.com/PacktPublishing/Full-stack-Django-and-React/issues/46">thread</a> by our reader <b>remyluslosius</b>.

## Errata
* Page 81 (line 19): ```post = serializers.SlugRelatedField(queryset=Post.objects.all(), slug_field='public_id')
* Page 81 (line 19):
```
post = serializers.SlugRelatedField(queryset=Post.objects.all(), slug_field='public_id')
def to_representation(self, instance):
rep = super().to_representation(instance)```_should be_
```post = serializers.SlugRelatedField(queryset=Post.objects.all(), slug_field='public_id')
rep = super().to_representation(instance)
```
_should be_
```
post = serializers.SlugRelatedField(queryset=Post.objects.all(), slug_field='public_id')
def validate_author(self, value):
if self.context["request"].user != value:
if self.context["request"].user != value:
raise ValidationError("You can't create a post for another user.")
return value
def to_representation(self, instance):
rep = super().to_representation(instance)```
def to_representation(self, instance):
rep = super().to_representation(instance)
```

### Related products
* Becoming an Enterprise Django Developer [[Packt]](https://www.packtpub.com/product/becoming-an-enterprise-django-developer/9781801073639?_ga=2.198495151.1640498229.1673976945-1676364594.1662627481) [[Amazon]](https://www.amazon.in/Becoming-Enterprise-Django-Developer-applications/dp/1801073635)
Expand Down

0 comments on commit faab97e

Please sign in to comment.