aamalig / django-profile

Automatically exported from code.google.com/p/django-profile
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

TypeError at /accounts/profile/edit/avatar/crop/ in Firefox only #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Adding or changing an avatar in firefox results in this error after 
submitting the crop. It does not happen in IE. Any ideas?

Below is the traceback.

Environment:

Request Method: POST
Request URL: http://somesite.com/accounts/profile/edit/avatar/crop/
Django Version: 1.0-final-SVN-unknown
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'myproject.step',
 'myproject.homepage',
 'userprofile',
 'myproject.customprofile',
 'sorl.thumbnail',
 'gdata',
 'atom']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')

Traceback:
File "path/to/lib/python2.5/django/core/handlers/base.py" in get_response
  86.                 response = callback(request, *callback_args, 
**callback_kwargs)
File "/path/to/lib/python2.5/django/contrib/auth/decorators.py" in __call__
  67.             return self.view_func(request, *args, **kwargs)
File "/path/to/lib/python2.5/site-packages/userprofile/views.py" in 
avatarcrop
  245.         if form.is_valid():
File "/path/to/lib/python2.5/django/forms/forms.py" in is_valid
  120.         return self.is_bound and not bool(self.errors)
File "/path/to/lib/python2.5/django/forms/forms.py" in _get_errors
  111.             self.full_clean()
File "/path/to/lib/python2.5/django/forms/forms.py" in full_clean
  234.             self.cleaned_data = self.clean()
File "/path/to/lib/python2.5/site-packages/userprofile/forms.py" in clean
  76.         if int(self.cleaned_data.get('right')) - int
(self.cleaned_data.get('left')) < 96:

Exception Type: TypeError at /accounts/profile/edit/avatar/crop/
Exception Value: int() argument must be a string or a number, 
not 'NoneType'

Original issue reported on code.google.com by joshkap...@gmail.com on 31 Mar 2009 at 1:34

GoogleCodeExporter commented 8 years ago
I can't reproduce this error, but I have added and aditional check to the code 
to
make sure that this won't happen again.

Thanks for reporting.

Original comment by david.ru...@gmail.com on 5 Apr 2009 at 3:20

GoogleCodeExporter commented 8 years ago
Yup, that fixed it for me. Great job and many thanks.

Original comment by joshkap...@gmail.com on 6 Apr 2009 at 6:05

GoogleCodeExporter commented 8 years ago
For me i now have this error (i had no errors before your last commit) :

"Enter a whole number" 

when i try to crop the image... :(

Original comment by stephane.angel on 7 Apr 2009 at 9:34

GoogleCodeExporter commented 8 years ago
Posted values : 

bottom:86.70001220703125
left:29.79998779296875
right:97.79998779296875
top:18.70001220703125

Not int...

Original comment by stephane.angel on 7 Apr 2009 at 9:54

GoogleCodeExporter commented 8 years ago
Your release 387 is wrong because if i crop the avatar at the left of the image,
self.cleaned_data.get('left') will be 0 and then an error will be reported

I'm working an a patch to resolv my previous problem, this one, and to allow to 
not
crop the image

Original comment by stephane.angel on 7 Apr 2009 at 11:02

GoogleCodeExporter commented 8 years ago
I'll make a new issue for my patch

Original comment by stephane.angel on 7 Apr 2009 at 11:30

GoogleCodeExporter commented 8 years ago
I'm also having this problem on the last release (456).

The problem only happens on Internet Explorer :s

Original comment by claudi...@gmail.com on 22 Jul 2010 at 10:23

Attachments: