Skip to content

Commit

Permalink
Contentando a Codacy Parte 2
Browse files Browse the repository at this point in the history
  • Loading branch information
josjimjim committed Apr 24, 2017
1 parent 247072c commit 0f8050c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Metronus-Project/metronus_app/templatetags/custom_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,14 @@ def is_weekend(day, month, year):

@register.assignment_tag
def is_admin(actor):
if actor.user_type == 'A':
return True
else:
return False
return actor.user_type == 'A'


@register.assignment_tag
def has_role(actor):
if actor.user_type == 'E' or actor.user_type == 'A':
try:
if ProjectDepartmentEmployeeRole.objects.filter(employee_id=actor.id).count() > 0:
return True
else:
return False
return ProjectDepartmentEmployeeRole.objects.filter(employee_id=actor.id).count() > 0
except:
return False
else:
Expand Down
2 changes: 1 addition & 1 deletion Metronus-Project/metronus_app/test/testProjectMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def create_task_in_projdept(project, department):

n_dep = len(departments)
# Do the random test 5 times
for k in range(5):
for _ in range(5):
Task.objects.all().delete()

tasks_per_dpmt = [random.choice(range(11)) for _ in range(n_dep)]
Expand Down

0 comments on commit 0f8050c

Please sign in to comment.