Revision 038383b1 api/handlers.py

b/api/handlers.py
14 14
import string
15 15
import logging
16 16
from datetime import datetime, timedelta
17

  
17
import iso8601
18 18
from logic import backend, utils
19 19

  
20 20
log = logging.getLogger('synnefo.api.handlers')
......
144 144
        try:
145 145
            changes_since = request.GET.get("changes-since", 0)
146 146
            if changes_since:
147
                last_update = datetime.strptime(changes_since,
148
                                                "%Y-%m-%dT%H:%M:%S")
147
                last_update = iso8601.parse_date(changes_since)
149 148
                #return a badRequest if the changes_since is older than a limit
150
                if (datetime.now() - last_update >
149
                if (datetime.now(last_update.tzinfo) - last_update >
151 150
                    timedelta(seconds=settings.POLL_LIMIT)):
152 151
                    raise fault.badRequest
153 152
                virtual_servers = VirtualMachine.objects.filter(

Also available in: Unified diff