Revision af7bb62f pithos/api/util.py
b/pithos/api/util.py | ||
---|---|---|
323 | 323 |
except ValueError: |
324 | 324 |
raise BadRequest('Invalid sharing header') |
325 | 325 |
except AttributeError, e: |
326 |
raise Conflict(object_conflict_response(request, e.data))
|
|
326 |
raise Conflict(simple_list_response(request, e.data))
|
|
327 | 327 |
except QuotaError: |
328 | 328 |
raise RequestEntityTooLarge('Quota exceeded') |
329 | 329 |
if public is not None: |
... | ... | |
759 | 759 |
md5.update(data + ('\x00' * pad)) |
760 | 760 |
return md5.hexdigest().lower() |
761 | 761 |
|
762 |
def object_conflict_response(request, l):
|
|
762 |
def simple_list_response(request, l):
|
|
763 | 763 |
if request.serialization == 'text': |
764 | 764 |
return '\n'.join(l) + '\n' |
765 | 765 |
if request.serialization == 'xml': |
766 |
return render_to_string('conflicts.xml', {'conflicts': l})
|
|
766 |
return render_to_string('items.xml', {'items': l})
|
|
767 | 767 |
if request.serialization == 'json': |
768 | 768 |
return json.dumps(l) |
769 | 769 |
|
Also available in: Unified diff