My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 49: TypeError at /accounts/profile/edit/avatar/crop/ in Firefox only
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Apr 2009
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by joshkapple, Mar 30, 2009
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'



Comment 1 by david.rubert, Apr 05, 2009
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.
Status: Fixed
Comment 2 by joshkapple, Apr 06, 2009
Yup, that fixed it for me. Great job and many thanks.
Comment 3 by stephane.angel, Apr 07, 2009
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... :(
Comment 4 by stephane.angel, Apr 07, 2009
Posted values : 

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

Not int...
Comment 5 by stephane.angel, Apr 07, 2009
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
Comment 6 by stephane.angel, Apr 07, 2009
I'll make a new issue for my patch
Sign in to add a comment

Hosted by Google Code