Disable R0801 messages in pylintrc. R0801 messages indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication but in our case it's useless since it shows a lot of imports code or authors.
Patch by: Pawel Solyga
Review by: to-be-reviewed
from django import formsfrom django.contrib import adminfrom django.contrib.flatpages.models import FlatPagefrom django.utils.translation import ugettext_lazy as _class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/]+$', help_text = _("Example: '/about/contact/'. Make sure to have leading" " and trailing slashes."), error_message = _("This value must contain only letters, numbers," " underscores, dashes or slashes.")) class Meta: model = FlatPageclass FlatPageAdmin(admin.ModelAdmin): form = FlatpageForm fieldsets = ( (None, {'fields': ('url', 'title', 'content', 'sites')}), (_('Advanced options'), {'classes': ('collapse',), 'fields': ('enable_comments', 'registration_required', 'template_name')}), ) list_display = ('url', 'title') list_filter = ('sites', 'enable_comments', 'registration_required') search_fields = ('url', 'title')admin.site.register(FlatPage, FlatPageAdmin)