Skip to content

Commit

Permalink
add permissions, add missing migration, check migrations, remove dupl…
Browse files Browse the repository at this point in the history
…icate black check
  • Loading branch information
PetrDlouhy committed Nov 2, 2022
1 parent 32d3253 commit 718a3fa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
if [ "$matrix.DB_ENGINE" = 'mysql' ]; then
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u db_user -p mysql mysql
fi
python manage.py makemigrations --check --dry-run
python -W error::DeprecationWarning -m coverage run manage.py test
coverage xml && codecov
env:
Expand All @@ -114,7 +115,5 @@ jobs:
run: python -m isort . --check-only --diff
- name: Running black
run: black --check .
- name: Running black
run: black --check .
- name: Running mypy
run: mypy .
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by Django 4.0.8 on 2022-11-02 22:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("admin_tools_stats", "0016_dashboardstats_cache_values"),
]

operations = [
migrations.AlterModelOptions(
name="dashboardstats",
options={
"permissions": (("view_dashboard_stats", "Can view dashboard charts"),),
"verbose_name": "dashboard stats",
"verbose_name_plural": "dashboard stats",
},
),
migrations.AlterField(
model_name="cachedvalue",
name="time_scale",
field=models.CharField(
choices=[
("hours", "Hours"),
("days", "Days"),
("weeks", "Weeks"),
("months", "Months"),
("quarters", "Quarters"),
("years", "Years"),
],
default="days",
max_length=90,
verbose_name="Time scale",
),
),
migrations.AlterField(
model_name="dashboardstats",
name="cache_values",
field=models.BooleanField(
default=False,
help_text="If chart's values are cached, you will always get cached values, unless you pres reload/reload_all button",
verbose_name="cache charts values",
),
),
]
1 change: 1 addition & 0 deletions admin_tools_stats/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ class Meta:
db_table = "dashboard_stats"
verbose_name = _("dashboard stats")
verbose_name_plural = _("dashboard stats")
permissions = (("view_dashboard_stats", _("Can view dashboard charts")),)

def allowed_type_operation_field_name_choices(self):
return (op for op in operation if op[0] in self.allowed_type_operation_field_name)
Expand Down

0 comments on commit 718a3fa

Please sign in to comment.