Commit 3e1ee21d authored by Michal Čihař's avatar Michal Čihař

Move getting documentation url to Check object

parent f5810e55
......@@ -2,6 +2,7 @@
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
import trans
import re
PYTHON_PRINTF_MATCH = re.compile('''
......@@ -176,6 +177,15 @@ class Check(object):
'''
return language.code.split('_')[0] in vals
def get_doc_url(self):
'''
Returns link to documentation.
'''
return 'http://weblate.readthedocs.org/en/weblate-%s/usage.html#check-%s' % (
trans.VERSION,
self.check_id,
)
class SameCheck(Check):
......
......@@ -1027,10 +1027,7 @@ class Check(models.Model):
return trans.checks.CHECKS[self.check].description
def get_doc_url(self):
return 'http://weblate.readthedocs.org/en/weblate-%s/usage.html#check-%s' % (
trans.VERSION,
self.check,
)
return trans.checks.CHECKS[self.check].get_doc_url()
class Dictionary(models.Model):
project = models.ForeignKey(Project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment