Ticket #14823: serializers__init__nowarning.diff

File serializers__init__nowarning.diff, 797 bytes (added by miker985@…, 14 years ago)

Simple patch for serializers/init.py

  • django/core/serializers/__init__.py

     
    4848    directly into the global register of serializers. Adding serializers
    4949    directly is not a thread-safe operation.
    5050    """
     51    if not _serializers:
     52        _load_serializers()
    5153    module = importlib.import_module(serializer_module)
    5254    if serializers is None:
    5355        _serializers[format] = module
     
    5658
    5759def unregister_serializer(format):
    5860    "Unregister a given serializer. This is not a thread-safe operation."
     61    if not _serializers:
     62        _load_serializers()
    5963    del _serializers[format]
    6064
    6165def get_serializer(format):
Back to Top