Skip to content

Commit

Permalink
Merge pull request #570 from nofusscomputing/feature-next-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc authored Feb 21, 2025
2 parents ad27501 + 79199e2 commit 9503f88
Show file tree
Hide file tree
Showing 634 changed files with 9,684 additions and 7,169 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
],
"cSpell.language": "en-AU",
"jest.enable": false,
"pylint.enabled": true,
"pylint.importStrategy": "fromEnvironment",
}
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,34 @@ clear; \
```





## Tips / Handy info

- To obtain a list of models _(in in the same order as the file system)_ using the db shell `python3 manage.py dbshell` run the following sql command:

``` sql

SELECT model FROM django_content_type ORDER BY app_label ASC, model ASC;

```
















# Old working docs


Expand Down
68 changes: 68 additions & 0 deletions Release-Notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@

## Version 1.11.0

**Note:** Migrations should be performed offline. **Failing to perform** an online migration, the option provided below will not be available if the migration crashes. Running the below commands to reset the database for the migrations to re-run will cause data loss if users are making changes to Centurion.

- History views removed from original Centurion interface.

- History views removed from API v1.

- A migration exists that will move the history from the old tables to the new ones.

if for some reason the migration crashes enter the following commands in the dbshell `python manage.py dbshell` and restart the migrations

``` sql

delete from access_organization_history;
delete from access_team_history;

delete from assistance_knowledge_base_history;
delete from assistance_knowledge_base_category_history;

delete from config_management_configgroups_history;
delete from config_management_configgroupsoftware_history;
delete from config_management_configgrouphosts_history;

delete from core_manufacturer_history;
delete from core_ticketcategory_history;
delete from core_ticketcommentcategory_history;

delete from itam_device_history;
delete from itam_devicemodel_history;
delete from itam_devicetype_history;
delete from itam_deviceoperatingsystem_history;
delete from itam_devicesoftware_history;
delete from itam_operatingsystem_history;
delete from itam_operatingsystemversion_history;
delete from itam_software_history;
delete from itam_softwareversion_history;
delete from itam_softwarecategory_history;

delete from itim_cluster_history;
delete from itim_clustertype_history;
delete from itim_port_history;
delete from itim_service_history;

delete from project_management_project_history;
delete from project_management_projectmilestone_history;
delete from project_management_projectstate_history;
delete from project_management_projecttype_history;
delete from settings_externallink_history;

delete from core_model_history;

```

The above commands truncate the data from the new history tables so the migration can run again.


## Version 1.10.0

- Nothing significant to report


## Version 1.9.0

- Nothing significant to report


## Version 1.8.0

- Prometheus exporter added. To enable metrics for the database you will have to update the database backend. see the [docs](https://nofusscomputing.com/projects/centurion_erp/administration/monitoring/#django-exporter-setup) for further information.
Expand Down
5 changes: 4 additions & 1 deletion app/access/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from django.contrib.auth.models import Group, User
from django.contrib.auth.admin import UserAdmin

from .models import *

from access.models.organization import Organization
from access.models.team import Team
from access.models.team_user import TeamUsers

admin.site.unregister(Group)

Expand Down
2 changes: 1 addition & 1 deletion app/access/forms/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from app import settings

from access.models import Organization
from access.models.organization import Organization

from core.forms.common import CommonModelForm

Expand Down
2 changes: 1 addition & 1 deletion app/access/forms/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from .team_users import TeamUsersForm, TeamUsers

from access.models import Team
from access.models.team import Team
from access.functions import permissions

from app import settings
Expand Down
2 changes: 1 addition & 1 deletion app/access/forms/team_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from app import settings

from access.models import TeamUsers
from access.models.team_user import TeamUsers

from core.forms.common import CommonModelForm

Expand Down
5 changes: 5 additions & 0 deletions app/access/functions/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ def permission_queryset():
'chordcounter',
'comment',
'groupresult',
'history',
'modelnotes',
'usersettings',
]

exclude_permissions = [
'add_history',
'add_organization',
'add_taskresult',
'change_history',
'change_organization',
'change_taskresult',
'delete_history',
'delete_organization',
'delete_taskresult',
'view_history',
]

return Permission.objects.filter(
Expand Down
5 changes: 4 additions & 1 deletion app/access/middleware/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from django.contrib.auth.models import User, Group
from django.utils.deprecation import MiddlewareMixin

from access.models import Organization, Team

from access.models.organization import Organization
from access.models.team import Team


from settings.models.app_settings import AppSettings

Expand Down
2 changes: 1 addition & 1 deletion app/access/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Migration(migrations.Migration):
('team_name', models.CharField(default='', max_length=50, verbose_name='Name')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False)),
('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.TenancyObject.validatate_organization_exists])),
('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists])),
],
options={
'verbose_name_plural': 'Teams',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='team',
name='organization',
field=models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.TenancyObject.validatate_organization_exists], verbose_name='Organization'),
field=models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization'),
),
migrations.AlterField(
model_name='team',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='team',
name='organization',
field=models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.Team.validatate_organization_exists], verbose_name='Organization'),
field=models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.team.Team.validatate_organization_exists], verbose_name='Organization'),
),
migrations.CreateModel(
name='OrganizationNotes',
Expand Down
43 changes: 43 additions & 0 deletions app/access/migrations/0004_organizationhistory_teamhistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 5.1.5 on 2025-02-20 13:25

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('access', '0003_alter_team_organization_organizationnotes_teamnotes'),
('core', '0015_modelhistory_manufacturerhistory_and_more'),
]

operations = [
migrations.CreateModel(
name='OrganizationHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.organization', verbose_name='Model')),
],
options={
'verbose_name': 'Organization History',
'verbose_name_plural': 'Organization History',
'db_table': 'access_organization_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
migrations.CreateModel(
name='TeamHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.team', verbose_name='Model')),
],
options={
'verbose_name': 'Team History',
'verbose_name_plural': 'Team History',
'db_table': 'access_team_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
]
4 changes: 3 additions & 1 deletion app/access/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from django.core.exceptions import PermissionDenied
from django.utils.functional import cached_property

from .models import Organization, Team
from access.models.organization import Organization
from access.models.team import Team



class OrganizationMixin():
Expand Down
4 changes: 3 additions & 1 deletion app/access/mixins/organization.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from django.contrib.auth.models import User, Group
from django.db import models

from access.models import Organization, Team
from access.models.organization import Organization
from access.models.team import Team



class OrganizationMixin:
Expand Down
2 changes: 1 addition & 1 deletion app/access/mixins/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rest_framework import exceptions
from rest_framework.permissions import DjangoObjectPermissions

from access.models import TenancyObject
from access.models.tenancy import TenancyObject

from core import exceptions as centurion_exceptions

Expand Down
Loading

0 comments on commit 9503f88

Please sign in to comment.