~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to djangoratings/fields.py

  • Committer: franku
  • Date: 2018-04-08 14:29:44 UTC
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: somal@arcor.de-20180408142944-rwtfq0r3p3momub8
is_authenticated is a now property

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
            key=self.field.key,
116
116
        )
117
117
 
118
 
        if not (user and user.is_authenticated()):
 
118
        if not (user and user.is_authenticated):
119
119
            if not ip_address:
120
120
                raise ValueError('``user`` or ``ip_address`` must be present.')
121
121
            kwargs['user__isnull'] = True
169
169
            raise InvalidRating('%s is not a valid choice for %s' %
170
170
                                (score, self.field.name))
171
171
 
172
 
        is_anonymous = (user is None or not user.is_authenticated())
 
172
        is_anonymous = (user is None or not user.is_authenticated)
173
173
        if is_anonymous and not self.field.allow_anonymous:
174
174
            raise AuthRequired("user must be a user, not '%r'" % (user,))
175
175