Skip to content

Commit

Permalink
uplift to Wagtail 2.2.2 on Django 2.0.9 (#3031)
Browse files Browse the repository at this point in the history
* uplift to Wagtail 2.2.2 on Django 2.0.9 with psycopg2 forced down to 2.7.7 because 2.8 is Django-breaking
  • Loading branch information
Pomax authored Apr 18, 2019
1 parent 0a3fea1 commit 4e130de
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 51 deletions.
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
"boto3" = "*"
Django = "==1.11.20"
Django = "==2.0.9"
dj-database-url = "*"
djangorestframework = "*"
django-admin-sortable = "*"
Expand All @@ -23,13 +23,13 @@ gunicorn = "*"
python-slugify = "*"
requests = "*"
social-auth-app-django = "*"
wagtail = "==2.1.3"
wagtail = "==2.2.2"
wagtail-factories = "*"
wagtail-inventory = "*"
wagtail-metadata = "*"
whitenoise = "*"
wagtail-modeltranslation = "*"
"psycopg2-binary" = "*"
wagtail-modeltranslation = "==0.10.1"
"psycopg2-binary" = "==2.7.7"
cloudinary = "*"
wagtail-experiments = "*"
pyyaml = "==4.2b4"
Expand Down
75 changes: 37 additions & 38 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions network-api/networkapi/buyersguide/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def check_locale(*args, **kwargs):


def filter_draft_products(request, products):
if request.user.is_authenticated():
if request.user.is_authenticated:
return products

return filter(lambda p: p['draft'] is False, products)
Expand Down Expand Up @@ -114,7 +114,7 @@ def category_view(request, slug):
def product_view(request, slug):
product = get_object_or_404(Product, slug=slug)

if product.draft and not request.user.is_authenticated():
if product.draft and not request.user.is_authenticated:
raise Http404("Product does not exist")

return render(request, 'product_page.html', {
Expand Down Expand Up @@ -189,7 +189,7 @@ def product_vote(request):
try:
product = Product.objects.get(id=product_id)

if product.draft and not request.user.is_authenticated():
if product.draft and not request.user.is_authenticated:
raise Http404("Product does not exist")

VoteClass = RangeVote
Expand Down
1 change: 0 additions & 1 deletion network-api/networkapi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',

'wagtail.core.middleware.SiteMiddleware',
Expand Down
8 changes: 4 additions & 4 deletions network-api/networkapi/wagtailpages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ class HomepageFeaturedNews(WagtailOrderable, models.Model):
'wagtailpages.Homepage',
related_name='featured_news',
)
news = models.ForeignKey('news.News', related_name='+')
news = models.ForeignKey('news.News', on_delete=models.CASCADE, related_name='+')
panels = [
SnippetChooserPanel('news'),
]
Expand All @@ -814,7 +814,7 @@ class HomepageFeaturedHighlights(WagtailOrderable, models.Model):
'wagtailpages.Homepage',
related_name='featured_highlights',
)
highlight = models.ForeignKey('highlights.Highlight', related_name='+')
highlight = models.ForeignKey('highlights.Highlight', on_delete=models.CASCADE, related_name='+')
panels = [
SnippetChooserPanel('highlight'),
]
Expand All @@ -833,7 +833,7 @@ class InitiativesHighlights(WagtailOrderable, models.Model):
'wagtailpages.InitiativesPage',
related_name='featured_highlights',
)
highlight = models.ForeignKey('highlights.Highlight', related_name='+')
highlight = models.ForeignKey('highlights.Highlight', on_delete=models.CASCADE, related_name='+')
panels = [
SnippetChooserPanel('highlight'),
]
Expand Down Expand Up @@ -916,7 +916,7 @@ class ParticipateHighlightsBase(WagtailOrderable, models.Model):
'wagtailpages.ParticipatePage2',
related_name='featured_highlights',
)
highlight = models.ForeignKey('highlights.Highlight', related_name='+')
highlight = models.ForeignKey('highlights.Highlight', on_delete=models.CASCADE, related_name='+')
commitment = models.CharField(
blank=True,
max_length=256,
Expand Down
2 changes: 1 addition & 1 deletion network-api/networkapi/wagtailpages/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_menu_pages(root, authenticated=False):

def get_mini_side_nav_data(context, page, no_minimum_page_count=False):
user = context['user']
authenticated = user.is_authenticated() if user else False
authenticated = user.is_authenticated if user else False
menu_pages = get_menu_pages(context['root'], authenticated)

# We need at least 2 pages, or a nav menu is meaningless.
Expand Down

0 comments on commit 4e130de

Please sign in to comment.