Skip to content

Commit

Permalink
Solo admins y execs pueden crear, cambio en la vista para que no salg…
Browse files Browse the repository at this point in the history
…a editar
  • Loading branch information
agubelu committed Jun 27, 2017
1 parent f1a4808 commit d7fb751
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Metronus-Project/metronus/templates/employee/employee_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ <h3 class="name_title">{{employee.user.first_name}}</h3>

<span>{% trans 'registryDate' %}: {{employee.registryDate}}</span>
</li>
<li style="text-align: center">
<span>
<a href="{% url 'employee_edit' employee.user.username %}" type="button" class="btn btn-primary">{% trans 'update' %}</a>
</span>
</li>
{% if actor_is_executive or actor_is_admin %}
<li style="text-align: center">
<span>
<a href="{% url 'employee_edit' employee.user.username %}" type="button" class="btn btn-primary">{% trans 'update' %}</a>
</span>
</li>
{% endif %}
</ul>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create(request):
"""

# Check that the user is logged in and it's an administrator
admin = get_authorized_or_403(request)
admin = get_admin_executive_or_403(request)

# If it's a GET request, return an empty form
if request.method == "GET":
Expand Down Expand Up @@ -129,7 +129,7 @@ def create_async(request):
"""

# Check that the user is logged in and it's an administrator
admin = get_authorized_or_403(request)
admin = get_admin_executive_or_403(request)
errors = []
data = {
'success': True
Expand Down

0 comments on commit d7fb751

Please sign in to comment.