Skip to content

Commit

Permalink
default data_query.visit_code_sequence to null, setup, update for pat…
Browse files Browse the repository at this point in the history
…h changes in edc_visit_schedule
  • Loading branch information
erikvw committed Oct 9, 2023
1 parent d9c488e commit cea997c
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.11']
django-version: ['4.1', '4.2', 'dev']
django-version: ['4.2', 'dev']
services:
mysql:
image: mysql:latest
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ repos:
- "-x *test*.py"

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
language_version: python3.10
language_version: python3.11

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args:
Expand All @@ -42,7 +42,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: v1.31.0
rev: v1.32.0
hooks:
- id: yamllint
args:
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion data_manager_app/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib import admin
from django.urls import path
from django.urls import include, path
from edc_utils.paths_for_urlpatterns import paths_for_urlpatterns

from .admin_site import data_manager_app_admin
Expand All @@ -20,6 +20,7 @@
*paths_for_urlpatterns("edc_data_manager"),
path("data_manager_app/admin/", data_manager_app_admin.urls),
path("/admin/", admin.site.urls),
path("i18n/", include("django.conf.urls.i18n")),
path("", HomeView.as_view(), name="home_url"),
path("", HomeView.as_view(), name="administration_url"),
]
11 changes: 3 additions & 8 deletions data_manager_app/visit_schedules.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from dateutil.relativedelta import relativedelta
from edc_visit_schedule import (
Crf,
FormsCollection,
Requisition,
Schedule,
Visit,
VisitSchedule,
)
from edc_visit_schedule.schedule import Schedule
from edc_visit_schedule.tests import DummyPanel
from edc_visit_schedule.visit import Crf, FormsCollection, Requisition, Visit
from edc_visit_schedule.visit_schedule import VisitSchedule

from .lab_profiles import panel_one, panel_two

Expand Down
5 changes: 0 additions & 5 deletions edc_data_manager/models/data_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,9 @@ class DataQuery(DataQueryModelMixin, ActionModelMixin, SiteModelMixin, BaseUuidM

visit_code_sequence = models.IntegerField(
verbose_name="Visit code sequence",
default=0,
validators=[MinValueValidator(0), MaxValueValidator(25)],
null=True,
blank=True,
help_text=(
"Defaults to '0'. For example, when combined with the "
"visit code `1000` would make `1000.0`."
),
)

timepoint = models.DecimalField(null=True, decimal_places=1, max_digits=6)
Expand Down
7 changes: 2 additions & 5 deletions edc_data_manager/tests/tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_query_rule_questions_from_single_form(self):
url = reverse(
"edc_data_manager_admin:edc_data_manager_queryrule_change", args=(query_rule.pk,)
)
form = self.app.get(url, user=self.user).form
form = self.app.get(url, user=self.user).forms[1]
response = form.submit()
self.assertIn("Invalid. Select questions from one CRF only", str(response.text))

Expand Down Expand Up @@ -154,10 +154,7 @@ def test_data_query_add_and_permissions(self):
f"registered_subject={str(registered_subject.pk)}&"
f"sender={str(DataManagerUser.objects.get(username=self.user.username).pk)}"
)
try:
form = self.app.get(url, user=self.user).form
except TypeError:
form = self.app.get(url, user=self.user).forms[1]
form = self.app.get(url, user=self.user).forms[1]
form["title"] = "My first query"
form["query_text"] = "this is a query"
response = form.submit().follow()
Expand Down
1 change: 1 addition & 0 deletions edc_data_manager/tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
urlpatterns += [
path("accounts/", include("edc_auth.urls")),
path("admin/", admin.site.urls),
path("i18n/", include("django.conf.urls.i18n")),
path("", HomeView.as_view(), name="administration_url"),
path("", HomeView.as_view(), name="home_url"),
]
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=60", "setuptools-scm>=8.0"]

[tool.setuptools_scm]
write_to = "_version.py"
version_file="_version.py"

[tool.black]
line-length = 95
target-version = ["py310"]
target-version = ["py311"]
extend-exclude = '''^(.*\/)*\b(migrations)\b($|\/.*$)'''

[tool.isort]
profile = "black"
py_version = "310"
py_version = "311"
skip = [".tox", ".eggs", "migrations"]

[tool.coverage.run]
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ keywords = django Edc, data management, CRF, clinicedc, clinical trials
classifiers=
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 4.1
Framework :: Django :: 4.2
Intended Audience :: Developers
Intended Audience :: Science/Research
Operating System :: OS Independent
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
License :: OSI Approved :: GNU General Public License v3 (GPLv3)


[options]
python_requires = >=3.10
python_requires = >=3.11
zip_safe = False
include_package_data = True
packages = find:
Expand Down

0 comments on commit cea997c

Please sign in to comment.