Browse Source

Reduce the usage of request.project.

pull/217/head
Pēteris Caune 6 years ago
parent
commit
f2ae573872
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 5 additions and 10 deletions
  1. +0
    -3
      hc/accounts/views.py
  2. +0
    -2
      hc/front/views.py
  3. +4
    -4
      templates/base.html
  4. +1
    -1
      templates/front/my_checks_desktop.html

+ 0
- 3
hc/accounts/views.py View File

@ -204,9 +204,6 @@ def profile(request):
profile.current_project = None
profile.save()
if request.project == project:
request.project = None
Member.objects.filter(project=project, user=request.user).delete()
ctx["left_project"] = project


+ 0
- 2
hc/front/views.py View File

@ -102,7 +102,6 @@ def my_checks(request, code):
request.profile.save()
if request.profile.current_project_id != project.id:
request.project = project
request.profile.current_project = project
request.profile.save()
@ -486,7 +485,6 @@ def status_single(request, code):
@login_required
# @project_required
def channels(request):
if request.method == "POST":
code = request.POST["channel"]


+ 4
- 4
templates/base.html View File

@ -89,9 +89,9 @@
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="nav-main-sections" class="nav navbar-nav">
{% if request.user.is_authenticated and request.project %}
{% if request.user.is_authenticated and request.profile.current_project %}
<li {% if page == 'checks' %} class="active" {% endif %}>
<a href="{% url 'hc-checks' request.project.code %}">Checks</a>
<a href="{% url 'hc-checks' request.profile.current_project.code %}">Checks</a>
</li>
<li {% if page == 'channels' %} class="active" {% endif %}>
@ -118,8 +118,8 @@
<a id="nav-email" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
{% if check %}
{{ check.project }}
{% elif request.project %}
{{ request.project }}
{% elif request.profile.current_project %}
{{ request.profile.current_project }}
{% else %}
{{ request.user.email }}
{% endif %}


+ 1
- 1
templates/front/my_checks_desktop.html View File

@ -2,7 +2,7 @@
<table
id="checks-table"
class="table"
data-status-url="{% url 'hc-status' request.project.code %}">
data-status-url="{% url 'hc-status' project.code %}">
<tr>
<th></th>
<th class="th-name">


Loading…
Cancel
Save