Skip to content

Commit daadc79

Browse files
committed
Fixed code block styling in README.
1 parent d860859 commit daadc79

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,18 @@ A classic example of this would be to attach ``Profile`` data
4646
to ``User`` object so calling ``request.user.profile`` does not incur a
4747
database hit. Here's how we can implement it.
4848

49-
```python
49+
.. code-block:: python
5050
51-
def attach_profile(user, request):
52-
try:
53-
user.get_profile()
54-
# Handle exception for user with no profile and AnonymousUser
55-
except (Profile.DoesNotExist, AttributeError):
56-
pass
51+
def attach_profile(user, request):
52+
try:
53+
user.get_profile()
54+
# Handle exception for user with no profile and AnonymousUser
55+
except (Profile.DoesNotExist, AttributeError):
56+
pass
5757
5858
59-
# In settings.py:
60-
CACHED_AUTH_PREPROCESSOR = 'path.to.module.attach_profile'
61-
```
59+
# In settings.py:
60+
CACHED_AUTH_PREPROCESSOR = 'path.to.module.attach_profile'
6261
6362
Running Tests
6463
-------------

0 commit comments

Comments
 (0)