Skip to content

Commit 3c45a5f

Browse files
committed
added login_required to admin urls
1 parent 5e4c7df commit 3c45a5f

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ class RichText(models.Model):
140140
**Full list of variables in template context:**
141141
- `block_model` (lowercase of modelname - "richtext")
142142
- `block_unique_id` (unique string)
143-
- `block_content` (block data from db
144-
- `as_list`
143+
- `block_content` (block data from db)
144+
- `as_list` (boolean)
145145
- `options` ([block options](#block-options))
146146

147147
**6. Add StreamField to your model in your application**

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="django-streamfield",
8-
version="1.2.1",
8+
version="1.2.2",
99
author="Yury Lapshinov",
1010
author_email="y.raagin@gmail.com",
1111
description="StreamField for native Django Admin or with Grappelli",

streamfield/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
name = "streamfield"
2-
VERSION = '1.2.1'
2+
VERSION = '1.2.2'

streamfield/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from importlib import import_module
22
from django.urls import include, path
33
from django.conf import settings
4+
from django.contrib.auth.decorators import login_required
45

56
from . import views
67

@@ -17,13 +18,13 @@
1718
if not model._meta.abstract:
1819
block_path = path(
1920
'admin-instance/%s/<int:pk>' % model.__name__.lower(),
20-
views.admin_instance_class(model).as_view(),
21+
login_required(views.admin_instance_class(model).as_view()),
2122
name='admin-instance'
2223
)
2324
else:
2425
block_path = path(
2526
'abstract-block/%s/' % model.__name__.lower(),
26-
views.abstract_block_class(model).as_view(),
27+
login_required(views.abstract_block_class(model).as_view()),
2728
name='abstract-block'
2829
)
2930

test_project/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Django==2.2.9
2-
django-grappelli==2.13.1
2+
django-grappelli==2.13.3

0 commit comments

Comments
 (0)