=== modified file 'sweetter/sweetter/sweet_utils.py' --- sweetter/sweetter/sweet_utils.py 2008-09-16 18:10:16 +0000 +++ sweetter/sweetter/sweet_utils.py 2008-09-18 18:34:46 +0000 @@ -1045,13 +1045,16 @@ from datetime import datetime u = user reply = re.compile("@([A-Za-z_\-\d]*)") - + url = re.compile("((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)") if comment == "": msg = _("write before press enter...") raise Exception(msg) elif len(comment) > COMMENT_SIZE: msg = _("your comment is too long") raise Exception(msg) + elif url.search(comment) and Sweets.get_num_entries_id(u.id)[1] < 1: + msg = _("You can not post URLs on your first post") + raise Exception(msg) # Limitamos el numero de post last = list(Sweets.select(Sweets.q.userID == u.id, orderBy=('-created'))[0:1])