fix source editorform for superusers
@@ -48,6 +48,8 @@ class EditorFormBase(I18nModelFormMixin, ModelForm):
sources = {s['name']: s for s in Source.objects.all().values('name', 'access_restriction_id',
'left', 'bottom', 'right', 'top')}
used_names = set(sources.keys())
+ if not creating:
+ used_names.remove(self.instance.name)
all_names = set(os.listdir(settings.SOURCES_ROOT))
self.fields['name'].widget = Select(choices=tuple((s, s) for s in sorted(all_names-used_names)))
