first_name = row[1].value
email = row[9].value
#FIXME:
- #email = self.admin_email
+ email = self.admin_email
username = slugify(first_name)[0] + '.' + slugify(last_name)
username = username[:30]
date = row[14].value
#FIXME: not for prod
user = User.objects.filter(username=username)
if user:
- user[0].delete()
+ user.delete()
user, created = User.objects.get_or_create(username=username, first_name=first_name,
last_name=last_name, email=email, date_joined = date_joined)
def get_context_data(self, **kwargs):
context = super(UsersView, self).get_context_data(**kwargs)
context['trainings'] = Training.objects.all()
- context['all_users'] = User.objects.all()
context['iejs'] = IEJ.objects.all()
context['courses'] = Course.objects.all()
paginator = NamePaginator(self.object_list, on="last_name", per_page=12)
def get_context_data(self, **kwargs):
context = super(UsersTrainingView, self).get_context_data(**kwargs)
context['training'] = Training.objects.get(id=self.args[0])
- context['all_users'] = self.object_list.all()
return context
@method_decorator(login_required)
def get_context_data(self, **kwargs):
context = super(UsersIejView, self).get_context_data(**kwargs)
context['iej'] = IEJ.objects.get(id=self.args[0])
- context['all_users'] = self.object_list.all()
return context
@method_decorator(login_required)
def get_context_data(self, **kwargs):
context = super(UsersCourseView, self).get_context_data(**kwargs)
context['course'] = Course.objects.get(id=self.args[0])
- context['all_users'] = self.object_list.all()
return context
@method_decorator(login_required)