Code Duplication    Length = 13-16 lines in 2 locations

met/metadataparser/forms.py 2 locations

@@ 126-141 (lines=16) @@
123
        return mark_safe('\n'.join(output))
124
125
126
class FederationForm(forms.ModelForm):
127
128
    def __init__(self, *args, **kwargs):
129
        super(FederationForm, self).__init__(*args, **kwargs)
130
        editor_users_choices = self.fields['editor_users'].widget.choices
131
        self.fields['editor_users'].widget = CheckboxSelectMultiple(
132
            choices=editor_users_choices)
133
        self.fields['editor_users'].help_text = _("This/these user(s) can edit this "
134
                                                  "federation and its entities")
135
136
        self.fields['file_url'].widget = MultiURLforMetadata()
137
138
    class Meta(object):
139
        model = Federation
140
        fields = ['name', 'url', 'registration_authority', 'country', 'logo',
141
                  'is_interfederation', 'type', 'fee_schedule_url', 'file_url', 'file', 'editor_users']
142
143
144
class EntityForm(forms.ModelForm):
@@ 144-156 (lines=13) @@
141
                  'is_interfederation', 'type', 'fee_schedule_url', 'file_url', 'file', 'editor_users']
142
143
144
class EntityForm(forms.ModelForm):
145
146
    def __init__(self, *args, **kwargs):
147
        super(EntityForm, self).__init__(*args, **kwargs)
148
        editor_users_choices = self.fields['editor_users'].widget.choices
149
        self.fields['editor_users'].widget = CheckboxSelectMultiple(
150
            choices=editor_users_choices)
151
        self.fields['editor_users'].help_text = _("These users can edit only "
152
                                                  "this entity")
153
154
    class Meta(object):
155
        model = Entity
156
        fields = ['registration_authority', 'file_url', 'file', 'editor_users']
157
158
159
class ChartForm(forms.Form):