educloudalliance / educloud-bazaar-legacy

Service and material distribution channel
4 stars 2 forks source link

No non-ascii letters allowed when posting tags via PUT #43

Open ilmoeuro opened 9 years ago

ilmoeuro commented 9 years ago

When sending a REST PUT request to /api/cms/{organization}/{collection}/{uuid}/ with a "tags" entry containing non-ASCII letters, the request is rejected.

Part of the stack trace (/var/www/pilvivayla-basaari/sites/basaar/apps/api/views.py in updateExistingItem):

    if "tags" in DATA:
        tagList = DATA["tags"]
        if len(tagList) > 10:
            raise TooMuchTags()
        for tag in tagList:
            print tag # <== THIS HERE LINE CRASHED
            #check if the tag is already in db, if not create it
            if Tag.objects.filter(name=tag).exists():
                t = Tag.objects.get(name=tag)
                t.hasTags.add(obj)
            else:
                tagEntry = Tag.create()