mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 22:12:14 +00:00
Compare commits
10 Commits
hotfix-dis
...
assets_mis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5696cf73ce | ||
|
|
096ca24336 | ||
| c779c24d63 | |||
| dad9797f74 | |||
| 69facd5dc6 | |||
| 406a9dad36 | |||
| 81c32baa8e | |||
| eef0682e4f | |||
| 2465390889 | |||
| fc9ce9f01c |
@@ -1,9 +0,0 @@
|
|||||||
{% extends 'base_rigs.html' %}
|
|
||||||
|
|
||||||
{% block title %}Password Reset Disabled{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<h1>Password reset is disabled</h1>
|
|
||||||
<p> We are very sorry for the inconvenience, but due to a security vulnerability, password reset is currently disabled until the vulnerability can be patched.</p>
|
|
||||||
<p> If you are locked out of your account, please contact an administrator and we can manually perform a reset</p>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -19,7 +19,7 @@ urlpatterns = [
|
|||||||
url('^user/login/$', views.login, name='login'),
|
url('^user/login/$', views.login, name='login'),
|
||||||
url('^user/login/embed/$', xframe_options_exempt(views.login_embed), name='login_embed'),
|
url('^user/login/embed/$', xframe_options_exempt(views.login_embed), name='login_embed'),
|
||||||
|
|
||||||
url(r'^user/password_reset/$', views.PasswordResetDisabled.as_view()),
|
url(r'^user/password_reset/$', password_reset, {'password_reset_form': forms.PasswordReset}),
|
||||||
|
|
||||||
# People
|
# People
|
||||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
|
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
|
||||||
|
|||||||
@@ -392,7 +392,3 @@ class ResetApiKey(generic.RedirectView):
|
|||||||
self.request.user.save()
|
self.request.user.save()
|
||||||
|
|
||||||
return reverse_lazy('profile_detail')
|
return reverse_lazy('profile_detail')
|
||||||
|
|
||||||
|
|
||||||
class PasswordResetDisabled(generic.TemplateView):
|
|
||||||
template_name = "RIGS/password_reset_disable.html"
|
|
||||||
|
|||||||
21
assets/migrations/0009_auto_20200102_1933.py
Normal file
21
assets/migrations/0009_auto_20200102_1933.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 2.0.13 on 2020-01-02 19:33
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0008_auto_20191206_2124'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='assetcategory',
|
||||||
|
options={'ordering': ['name'], 'verbose_name': 'Asset Category', 'verbose_name_plural': 'Asset Categories'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='assetstatus',
|
||||||
|
options={'ordering': ['name'], 'verbose_name': 'Asset Status', 'verbose_name_plural': 'Asset Statuses'},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
# Generated by Django 2.0.13 on 2020-01-03 22:15
|
# Generated by Django 2.0.13 on 2020-01-02 20:42
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
replaces = [('assets', '0009_auto_20200102_1933'), ('assets', '0010_assetstatus_display_class'), ('assets', '0011_auto_20200102_2040')]
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('assets', '0008_auto_20191206_2124'),
|
('assets', '0008_auto_20191206_2124'),
|
||||||
]
|
]
|
||||||
@@ -22,11 +23,6 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='assetstatus',
|
model_name='assetstatus',
|
||||||
name='display_class',
|
name='display_class',
|
||||||
field=models.CharField(blank=True, help_text='HTML class to be appended to alter display of assets with this status, such as in the list.', max_length=80, null=True),
|
field=models.CharField(help_text='HTML class to be appended to alter display of assets with this status, such as in the list.', max_length=80),
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='asset',
|
|
||||||
name='purchased_from',
|
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='assets', to='assets.Supplier'),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
18
assets/migrations/0010_assetstatus_display_class.py
Normal file
18
assets/migrations/0010_assetstatus_display_class.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.0.13 on 2020-01-02 19:35
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0009_auto_20200102_1933'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='assetstatus',
|
||||||
|
name='display_class',
|
||||||
|
field=models.TextField(default='', help_text='HTML class to be appended to alter display of assets with this status, such as in the list.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
19
assets/migrations/0010_auto_20200103_2134.py
Normal file
19
assets/migrations/0010_auto_20200103_2134.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.0.13 on 2020-01-03 21:34
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0009_auto_20200102_1933_squashed_0011_auto_20200102_2040'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='asset',
|
||||||
|
name='purchased_from',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='assets', to='assets.Supplier'),
|
||||||
|
),
|
||||||
|
]
|
||||||
18
assets/migrations/0011_auto_20200102_2040.py
Normal file
18
assets/migrations/0011_auto_20200102_2040.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.0.13 on 2020-01-02 20:40
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('assets', '0010_assetstatus_display_class'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='assetstatus',
|
||||||
|
name='display_class',
|
||||||
|
field=models.CharField(help_text='HTML class to be appended to alter display of assets with this status, such as in the list.', max_length=80),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -33,7 +33,7 @@ class AssetStatus(models.Model):
|
|||||||
name = models.CharField(max_length=80)
|
name = models.CharField(max_length=80)
|
||||||
should_show = models.BooleanField(
|
should_show = models.BooleanField(
|
||||||
default=True, help_text="Should this be shown by default in the asset list.")
|
default=True, help_text="Should this be shown by default in the asset list.")
|
||||||
display_class = models.CharField(max_length=80, blank=True, null=True, help_text="HTML class to be appended to alter display of assets with this status, such as in the list.")
|
display_class = models.CharField(max_length=80, help_text="HTML class to be appended to alter display of assets with this status, such as in the list.")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% if not edit and perms.assets.view_asset %}
|
{% if not edit %}
|
||||||
<div class="col-sm-12 text-right">
|
<div class="col-sm-12 text-right">
|
||||||
<div>
|
<div>
|
||||||
<a href="{% url 'asset_history' object.asset_id %}" title="View Revision History">
|
<a href="{% url 'asset_history' object.asset_id %}" title="View Revision History">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ urlpatterns = [
|
|||||||
(views.AssetEdit.as_view()), name='asset_update'),
|
(views.AssetEdit.as_view()), name='asset_update'),
|
||||||
path('asset/id/<str:pk>/duplicate/', permission_required_with_403('assets.add_asset')
|
path('asset/id/<str:pk>/duplicate/', permission_required_with_403('assets.add_asset')
|
||||||
(views.AssetDuplicate.as_view()), name='asset_duplicate'),
|
(views.AssetDuplicate.as_view()), name='asset_duplicate'),
|
||||||
path('asset/id/<str:pk>/history/', permission_required_with_403('assets.view_asset')(views.AssetVersionHistory.as_view()),
|
path('asset/id/<str:pk>/history/', views.AssetVersionHistory.as_view(),
|
||||||
name='asset_history', kwargs={'model': models.Asset}),
|
name='asset_history', kwargs={'model': models.Asset}),
|
||||||
path('activity', permission_required_with_403('assets.view_asset')
|
path('activity', permission_required_with_403('assets.view_asset')
|
||||||
(views.ActivityTable.as_view()), name='asset_activity_table'),
|
(views.ActivityTable.as_view()), name='asset_activity_table'),
|
||||||
|
|||||||
@@ -213,9 +213,8 @@ class SupplierVersionHistory(versioning.VersionHistory):
|
|||||||
template_name = "asset_version_history.html"
|
template_name = "asset_version_history.html"
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Reduce SQL queries
|
||||||
class AssetVersionHistory(versioning.VersionHistory):
|
class AssetVersionHistory(versioning.VersionHistory):
|
||||||
template_name = "asset_version_history.html"
|
|
||||||
|
|
||||||
def get_object(self, **kwargs):
|
def get_object(self, **kwargs):
|
||||||
return get_object_or_404(models.Asset, asset_id=self.kwargs['pk'])
|
return get_object_or_404(models.Asset, asset_id=self.kwargs['pk'])
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block titleelements %}
|
{% block titleelements %}
|
||||||
{# % if perms.assets.view_asset % #}
|
{% if perms.assets.view_asset %}
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Assets<b class="caret"></b></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Assets<b class="caret"></b></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
@@ -20,19 +20,19 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{# % endif % #}
|
{% endif %}
|
||||||
{# % if perms.assets.view_supplier % #}
|
{% if perms.assets.view_supplier %}
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> Suppliers<b class="caret"></b></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> Suppliers<b class="caret"></b></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="{% url 'supplier_list' %}"><span class="glyphicon glyphicon-list"></span>
|
<li><a href="{% url 'supplier_list' %}"><span class="glyphicon glyphicon-list"></span>
|
||||||
List Suppliers</a></li>
|
List Suppliers</a></li>
|
||||||
{% if perms.assets.add_supplier %}
|
{% if perms.assets.add_asset %}
|
||||||
<li><a href="{% url 'supplier_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Supplier</a></li>
|
<li><a href="{% url 'supplier_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Supplier</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{# % endif % #}
|
{% endif %}
|
||||||
{% if perms.assets.view_asset %}
|
{% if perms.assets.view_asset %}
|
||||||
<li><a href="{% url 'asset_activity_table' %}">Recent Changes</a></li>
|
<li><a href="{% url 'asset_activity_table' %}">Recent Changes</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user