Skip to content

Commit

Permalink
fix typos and rearrange imports & add new lines EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
catborise committed Jun 4, 2020
1 parent e21f423 commit e46bb99
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 33 deletions.
1 change: 0 additions & 1 deletion accounts/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,3 @@ <h3 class="page-header">{% trans "SSH Keys" %}</h3>
</div>
</div>
{% endblock %}

4 changes: 1 addition & 3 deletions accounts/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.conf import settings
from django.core.validators import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import render
Expand All @@ -22,7 +21,6 @@ def profile(request):
error_messages = []
# user = User.objects.get(id=request.user.id)
publickeys = UserSSHKey.objects.filter(user_id=request.user.id)
themes_list = os.listdir(settings.SCSS_DIR +"/wvc-theme")

if request.method == 'POST':
if 'username' in request.POST:
Expand Down Expand Up @@ -104,7 +102,7 @@ def account(request, user_id):
return HttpResponseRedirect(request.get_full_path())
if 'add' in request.POST:
inst_id = request.POST.get('inst_id', '')

if AppSettings.objects.get(key="ALLOW_INSTANCE_MULTIPLE_OWNER").value == 'True':
check_inst = UserInstance.objects.filter(instance_id=int(inst_id), user_id=int(user_id))
else:
Expand Down
10 changes: 5 additions & 5 deletions admin/templates/admin/common/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

{% block content %}
{% if create_url %}
<a class="btn btn-success float-right" href="{% url create_url %}">{% icon 'plus' %} {%trans "Create New" %}</a>
<a class="btn btn-success float-right" href="{% url create_url %}">{% icon 'plus' %} {%trans "Create New" %}</a>
{% endif %}
<table class="table table-hover table-striped">
<table class="table table-hover">
{% for object in object_list %}
<tr>
<td>{{ object }}
<div class="btn-group float-right">
<a class="btn btn-success" href="{% url update_url object.id %}">{% icon 'edit' %} {%trans "Edit"%}</a>
{% if extra_urls %}
{% for url in extra_urls %}
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
{% endfor %}
{% for url in extra_urls %}
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
{% endfor %}
{% endif %}
<a class="btn btn-danger" href="{% url delete_url object.id %}">{% icon 'times' %} {%trans "Delete" %}</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.utils.translation import ugettext_lazy as _

from accounts.models import UserAttributes
from appsettings.views import AppSettings
from appsettings.models import AppSettings
from logs.models import Logs

from . import forms
Expand Down
2 changes: 1 addition & 1 deletion appsettings/migrations/0002_auto_20200527_1603.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ class Migration(migrations.Migration):

operations = [
migrations.RunPython(add_default_settings, del_default_settings),
]
]
2 changes: 1 addition & 1 deletion computes/templates/create_comp_block.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}
{% load bootstrap4 %}
{% load font_awesome %}
<div class="btn-group float-right">
<div class="btn-group float-right" role="group" aria-label="Add host button group">
<a href="{% url 'add_tcp_host' %}" class="btn btn-success">{% trans "TCP" %}</a>
<a href="{% url 'add_ssh_host' %}" class="btn btn-success">{% trans "SSH" %}</a>
<a href="{% url 'add_tls_host' %}" class="btn btn-success">{% trans "TLS" %}</a>
Expand Down
2 changes: 1 addition & 1 deletion computes/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from django.urls import path, include

from . import views
from . import forms
from create.views import create_instance, create_instance_select_type
from instances.views import instances
from interfaces.views import interface, interfaces
from networks.views import network, networks
from nwfilters.views import nwfilter, nwfilters
from secrets.views import secrets
from storages.views import get_volumes, storage, storages
from . import forms

urlpatterns = [
path('', views.computes, name='computes'),
Expand Down
10 changes: 5 additions & 5 deletions create/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ def create_instance(request, compute_id, arch, machine):
error_messages.append(error_msg)
else:
clone_path = conn.clone_from_template(
data['name'],
templ_path,
data['storage'],
meta_prealloc,
default_disk_owner_uid,
data['name'],
templ_path,
data['storage'],
meta_prealloc,
default_disk_owner_uid,
default_disk_owner_gid)
volume = dict()
volume['path'] = clone_path
Expand Down
2 changes: 1 addition & 1 deletion instances/templates/allinstances_index_nongrouped.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<table class="table table-hover table-striped sortable-theme-bootstrap" data-sortable>
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>
Expand Down
2 changes: 1 addition & 1 deletion instances/templates/bottom_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
</ul>
</div>
</div>
</nav>
</nav>
2 changes: 0 additions & 2 deletions logs/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import json

from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse

from admin.decorators import superuser_only
from appsettings.models import AppSettings
from instances.models import Instance
from logs.models import Logs

Expand Down
3 changes: 0 additions & 3 deletions nwfilters/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

# Create your models here.
2 changes: 1 addition & 1 deletion secrets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ def secrets(request, compute_id):
except libvirtError as err:
error_messages.append(err)

return render(request, 'secrets.html', locals())
return render(request, 'secrets.html', locals())
2 changes: 1 addition & 1 deletion static/css/webvirtcloud.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* Global Styles */

body {
padding-bottom: 40px;
padding-bottom: 50px;
}

.container {
Expand Down
9 changes: 5 additions & 4 deletions storages/views.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import json
from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from libvirt import libvirtError

from admin.decorators import superuser_only
from computes.models import Compute
from appsettings.models import AppSettings
from storages.forms import AddStgPool, AddImage, CloneImage
from vrtManager.storage import wvmStorage, wvmStorages
from libvirt import libvirtError
from django.contrib import messages
from admin.decorators import superuser_only


@superuser_only
Expand Down
2 changes: 1 addition & 1 deletion templates/403.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_auth.html" %}
{% load i18n %}
{% block title %}{% trans "404" %}{% endblock %}
{% block title %}{% trans "403" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-12 text-center">
Expand Down
3 changes: 2 additions & 1 deletion webvirtcloud/settings.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ INSTALLED_APPS = [
'fa',
'accounts',
'admin',
'appsettings',
'computes',
'console',
'create',
Expand All @@ -35,7 +36,6 @@ INSTALLED_APPS = [
'nwfilters',
'storages',
'secrets',
'appsettings',
'logs',
]

Expand Down Expand Up @@ -164,5 +164,6 @@ QEMU_KEYMAPS = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
LIBVIRT_KEEPALIVE_INTERVAL = 5
LIBVIRT_KEEPALIVE_COUNT = 5

ALLOW_EMPTY_PASSWORD = False
NEW_USER_DEFAULT_INSTANCES = []
SHOW_PROFILE_EDIT_PASSWORD = True

0 comments on commit e46bb99

Please sign in to comment.