Skip to content
Snippets Groups Projects
Commit 131423c4 authored by Jean-Philippe Laverdure's avatar Jean-Philippe Laverdure
Browse files

linting fixes

parent 455eb169
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,6 @@ class DataFilesView(LoginRequiredMixin, ActivePageViewMixin, AjaxDatatableBackbo
context['batch_remove_datafile_annotation_form'] = BatchRemoveDataFileAnnotationForm()
context['batch_add_datafile_annotation_form'] = BatchAddDataFileAnnotationForm()
context['batch_deletebulk_datafile_form'] = BatchDeleteDataFileForm()
context['dt_struct']['headers'] = context['dt_struct']['headers'] + [_('Actions')]
return context
......@@ -472,7 +470,6 @@ class DataFileDeleteView(LoginRequiredMixin, DeleteViewMixin, DeleteView):
return HttpResponseRedirect(self.get_success_url())
class DataFileBatchDelete(LoginRequiredMixin, SuccessMessageMixin, View):
http_method_names = ['post']
success_url = reverse_lazy("user.datafiles")
......@@ -486,7 +483,8 @@ class DataFileBatchDelete(LoginRequiredMixin, SuccessMessageMixin, View):
if not DataFile.objects.editable_by_profile(request.user.profile).filter(pk=f.pk).first():
messages.error(self.request, _('You do not have the necessary permissions to delete the file "{}"'.format(f)))
elif f.datasets.exists():
messages.error(self.request,
messages.error(
self.request,
'{0}<br />{1}<br />{2}'.format(
f,
_('File cannot be deleted because it is currently attached to these DataSets:'),
......
......@@ -199,12 +199,12 @@ class UserUpdateView(StaffViewMixin, AppSettingsMixin, UpdateViewMixin, UpdateVi
if not user.profile.accountname:
user.username = form.cleaned_data['email']
elif profile_form.cleaned_data['accountname']:
ldap_user = _LDAPUser(LDAPBackend(), username=profile_form.cleaned_data['accountname'])
if ldap_user and 'mail' in ldap_user.attrs:
ldap_email = ldap_user.attrs.get('mail')[0]
if ldap_email:
user.username = profile_form.cleaned_data['accountname']
user.email = ldap_email
ldap_user = _LDAPUser(LDAPBackend(), username=profile_form.cleaned_data['accountname'])
if ldap_user and 'mail' in ldap_user.attrs:
ldap_email = ldap_user.attrs.get('mail')[0]
if ldap_email:
user.username = profile_form.cleaned_data['accountname']
user.email = ldap_email
user.save()
profile_form.save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment