mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 23:02:19 +00:00
Fix the issues with adding notes, also make the permission more obvious on the index
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if hrstaff %}
|
{% if is_hr_staff %}
|
||||||
<h3>HR Admin</h3>
|
<h3>HR Admin</h3>
|
||||||
<p>
|
<p>
|
||||||
<a href="{% url hr-admin %}">View applications</a><br/>
|
<a href="{% url hr-admin %}">View applications</a><br/>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class HrIndexView(TemplateView):
|
|||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(HrIndexView, self).get_context_data(**kwargs)
|
context = super(HrIndexView, self).get_context_data(**kwargs)
|
||||||
context['hrstaff'] = check_permissions(self.request.user)
|
context['is_hr_staff'] = check_permissions(self.request.user)
|
||||||
context['can_recommend'] = len(blacklist_values(self.request.user, BLACKLIST_LEVEL_ADVISORY)) == 0
|
context['can_recommend'] = len(blacklist_values(self.request.user, BLACKLIST_LEVEL_ADVISORY)) == 0
|
||||||
return context
|
return context
|
||||||
|
|
||||||
@@ -228,9 +228,9 @@ class HrAddMessage(HrAddNote):
|
|||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
self.application = Application.objects.get(pk=kwargs.get('applicationid'))
|
self.application = Application.objects.get(pk=kwargs.get('applicationid'))
|
||||||
self.perm = check_permissions(request.user, self.application)
|
self.perm = check_permissions(request.user, self.application)
|
||||||
if not self.perm:
|
if self.perm == HR_NONE:
|
||||||
return HttpResponseRedirect(reverse('hr-index'))
|
return HttpResponseRedirect(reverse('hr-index'))
|
||||||
return super(HrAddMessage, self).dispatch(request, *args, **kwargs)
|
return CreateView.dispatch(self, request, *args, **kwargs)
|
||||||
|
|
||||||
def get_form_class(self):
|
def get_form_class(self):
|
||||||
if self.perm == HR_ADMIN:
|
if self.perm == HR_ADMIN:
|
||||||
|
|||||||
Reference in New Issue
Block a user