Skip to content

Commit

Permalink
Merge 0bd42f4 into aac8b79
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Jan 17, 2019
2 parents aac8b79 + 0bd42f4 commit 3084246
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ python:
- '3.5'
- '3.6'
env:
- DJANGO="Django>=1.8.0,<1.9.0"
- DJANGO="Django>=1.11,<1.12.0"
- DJANGO="Django>=2.0,<2.1"
- DJANGO="Django>=2.1,<2.2"
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
=================

* Removed Django 1.8 support

1.4.1 (2017-12-06)
==================

Expand Down
6 changes: 0 additions & 6 deletions pagetree/compat.py

This file was deleted.

5 changes: 2 additions & 3 deletions pagetree/generic/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def dispatch(self, request, *args, **kwargs):
from django.views.generic.base import View, TemplateView
from django.views.generic.edit import FormView

from pagetree.compat import user_is_anonymous
from pagetree.forms import CloneHierarchyForm
from pagetree.helpers import get_section_from_path
from pagetree.models import Hierarchy
Expand Down Expand Up @@ -99,7 +98,7 @@ def __init__(self, section, user):
self.user = user

def visit(self, status=None):
if user_is_anonymous(self.user):
if self.user.is_anonymous:
return
if not status:
prev = self.section.get_uservisit(self.user)
Expand Down Expand Up @@ -207,7 +206,7 @@ def gate_check(self, user):

# If this view is gated, and we have no user or an anonymous
# user, then just deny access.
if (not user) or user_is_anonymous(user):
if (not user) or user.is_anonymous:
raise PermissionDenied()

# we need to check that they have visited all previous pages
Expand Down
3 changes: 1 addition & 2 deletions pagetree/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import unicode_literals

from pagetree.compat import user_is_anonymous
from pagetree.models import Hierarchy
import warnings

Expand Down Expand Up @@ -55,7 +54,7 @@ def submitted(section, user):


def block_submitted(block, user):
if user_is_anonymous(user):
if user.is_anonymous:
# anon can't have submitted a block
return False
if hasattr(block, 'needs_submit'):
Expand Down
3 changes: 1 addition & 2 deletions pagetree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from treebeard.mp_tree import MP_Node
import django.core.exceptions
from treebeard.forms import movenodeform_factory
from pagetree.compat import user_is_anonymous


# dummy it out
Expand Down Expand Up @@ -128,7 +127,7 @@ def from_dict(d):
return h

def get_user_location(self, user):
if user_is_anonymous(user):
if user.is_anonymous:
return "/"
(ul, created) = UserLocation.objects.get_or_create(
user=user,
Expand Down

0 comments on commit 3084246

Please sign in to comment.