Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value Error #45

Open
RockyRx opened this issue Apr 16, 2010 · 1 comment
Open

Value Error #45

RockyRx opened this issue Apr 16, 2010 · 1 comment

Comments

@RockyRx
Copy link

RockyRx commented Apr 16, 2010

Traceback (most recent call last):

File "C:\Python26\lib\site-packages\django\core\servers\basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)

File "C:\Python26\lib\site-packages\django\core\servers\basehttp.py", line 651, in call
return self.application(environ, start_response)

File "C:\Python26\lib\site-packages\django\core\handlers\wsgi.py", line 241, in call
response = self.get_response(request)

File "C:\Python26\lib\site-packages\django\core\handlers\base.py", line 73, in get_response
response = middleware_method(request)

File "build\bdist.win32\egg\socialregistration\middleware.py", line 13, in process_request
request.facebook.check_session(request)

File "C:\Python26\lib\site-packages\facebook__init__.py", line 1293, in check_session
self.session_key_expires = int(params['expires'])

ValueError: invalid literal for int() with base 10: 'None'

@ljluestc
Copy link

class Facebook:
    def check_session(self, request):
        params = request.GET
        if 'session' in params:
            self.session_key = params['session_key']
            self.uid = int(params['uid'])
            self.session_key_expires = None
            if 'expires' in params and params['expires'] != 'None':
                try:
                    self.session_key_expires = int(params['expires'])
                except ValueError:
                    # Handle the case where params['expires'] is not a valid integer
                    # You can choose to log this error or handle it differently based on your requirements
                    pass
        else:
            self.session_key = None
            self.uid = None
            self.session_key_expires = None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants