mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] Patches for blog media_type


From: ayleph
Subject: [GMG-Devel] Patches for blog media_type
Date: Mon, 24 Aug 2015 00:07:21 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi gang,

I've got a number of small patches for the blog media_type that I'm
hoping to roll into a branch for review soon. I'd like some feedback on
my solution to one of the issues, explained below. There's also a Trac
ticket for this issue, but there's not much content on the ticket yet.

https://issues.mediagoblin.org/ticket/5316

The most annoying blog issue at the moment is that a user is allowed to
create a blog or blogpost with no title, which generates an empty slug
and causes a server crash when someone tries to access that blog or
blogpost. I've made a small change to fix this on my instance.

mediagoblin/media_types/blog/views.py:

- blog.title = six.text_type(form.title.data)
+ blog.title = (six.text_type(form.title.data) or u'untitled blog')

- blogpost.title = six.text_type(form.title.data)
+ blogpost.title = (six.text_type(form.title.data) or u'untitled blog post')

I have two questions about this approach.

1. Does it seem acceptable to default to a text string like this, or
would we rather just have some UUID-gen string? Note that if I make
multiple blogs or blogposts with the same title, the successive slugs do
get a generated bit tacked on to the end, so there's no issue with
defaulting to the same string for every blog or blogpost.
2. If the above approach sounds good, should I make the default strings
translatable, or just leave them in English?

Thanks,

-- 
ayleph


reply via email to

[Prev in Thread] Current Thread [Next in Thread]