~libravatar/libravatar/master

« back to all changes in this revision

Viewing changes to libravatar/account/forms.py

  • Committer: Francois Marier
  • Date: 2016-01-18 09:05:34 UTC
  • mto: This revision was merged to the branch mainline in revision 939.
  • Revision ID: git-v1:965cf04dbe4cdadbf7eeb027506180156599c7fb
Fix a few pylint errors and disable the rest as locally as possible

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
    can_distribute = forms.BooleanField(label=_('can be freely copied'), required=True,
118
118
                                        error_messages={'required': _('This field must be checked since we need to be able to distribute photos to third parties.')})
119
119
 
120
 
    # pylint: disable=R0201
 
120
    # pylint: disable=no-self-use
121
121
    def save(self, user, ip_address, image):
122
122
        # Link this file to the user's profile
123
 
        p = Photo()
124
 
        p.user = user
125
 
        p.ip_address = ip_address
126
 
        if not p.save(image):
 
123
        photo = Photo()
 
124
        photo.user = user
 
125
        photo.ip_address = ip_address
 
126
        if not photo.save(image):
127
127
            return None
128
 
        return p
 
128
        return photo
129
129
 
130
130
 
131
131
class PasswordResetForm(forms.Form):