mysql: Duplicate entry on inserting line to autolinking patterns

Hello! and welcome to the Black Mesa...

Sorry for new long post, but it is very interesting project to me and I want to help it in a way I can.
After some experiments with autolinkink patterns I found strange error on inserting any new line to existing autolinking patterns:


It all starts when I try to use supergreed quantificator (+) in pattern regexp. When I change/delete any (first or last) pattern or add any new line - error shows up. When I delete all patterns, reload page and add one or all patterns again, all works fine but only if I don't change patterns again.

Next strange thing is when I delete all the patterns (and leave an empty field) they don't remove from DB:

mysql> select * from livesettings_longsetting where like '%MARKUP%';

111MARKUPAUTO_LINK_URLS\1 http://\\2\1\1\1 http://help.local/question/\1
121MARKUPAUTO_LINK_PATTERNSuawiki:\((.+)\) (ru|en)wiki:\((.+)\) ����:\((.+)\) google:\((.+)\) �����:\((.+)\) ������?(\d+)

2 rows in set (0.00 sec)

Traceback (most recent call last):

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/core/handlers/", line 111, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/views/decorators/", line 79, in _wrapped_view_func
   response = view_func(request, *args, **kwargs)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/contrib/admin/views/", line 19, in _checklogin
   return view_func(request, *args, **kwargs)

 File "/var/src/askbot-devel/askbot/deps/livesettings/", line 45, in group_settings
   if cfg.update(value):

 File "/var/src/askbot-devel/askbot/deps/livesettings/", line 366, in update

 File "/var/src/askbot-devel/askbot/deps/livesettings/", line 165, in save
   super(LongSetting, self).save(force_insert=force_insert, force_update=force_update)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/models/", line 460, in save
   self.save_base(using=using, force_insert=force_insert, force_update=force_update)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/models/", line 553, in save_base
   result = manager._insert(values, return_id=update_pk, using=using)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/models/", line 195, in _insert
   return insert_query(self.model, values, **kwargs)

 File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/models ...
Olloff's avatar
asked 2012-04-02 21:14:08 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments