Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
janno42 committed Sep 9, 2024
2 parents 1208607 + ead8ffd commit 6f284b2
Show file tree
Hide file tree
Showing 42 changed files with 5,522 additions and 5,634 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ updates:
labels:
- "[T] Dependencies"
versioning-strategy: "increase-if-necessary"
ignore:
- dependency-name: "django-stubs"
update-types: ["version-update:semver-patch"]
- dependency-name: "ruff"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "npm"
directory: "/"
schedule:
Expand Down
12 changes: 6 additions & 6 deletions deployment/localsettings.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql', # postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'evap', # Or path to database file if using sqlite3.
'USER': 'evap', # Not used with sqlite3.
'PASSWORD': 'evap', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'evap',
'USER': 'evap',
'PASSWORD': 'evap',
'HOST': '127.0.0.1', # Set to empty string for localhost.
'PORT': '', # Set to empty string for default.
'CONN_MAX_AGE': 600,
}
}
Expand Down
7 changes: 6 additions & 1 deletion deployment/provision_vagrant_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ cp /etc/skel/.bashrc /home/$USER/
OWNER=$(stat -c %u "$MOUNTPOINT/evap")
apt-get -q install -y bindfs
mkdir -p "$REPO_FOLDER"
bindfs --map="$OWNER/1042:@$OWNER/@1042" "$MOUNTPOINT" "$REPO_FOLDER" || exit 1
# remount if REPO_FOLDER does not contain any files (meaning it is not mounted)
if [[ -z $(ls -A "$REPO_FOLDER") ]]; then
bindfs --map="$OWNER/1042:@$OWNER/@1042" "$MOUNTPOINT" "$REPO_FOLDER" || exit 1
else
echo "Skipped trying to mount $REPO_FOLDER - a mounted folder was already detected."
fi
echo "[[ -z \$(ls -A '$REPO_FOLDER') ]] && sudo bindfs --map='$OWNER/1042:@$OWNER/@1042' '$MOUNTPOINT' '$REPO_FOLDER' # remount iff folder empty" >> /home/$USER/.bashrc

# allow ssh login
Expand Down
44 changes: 0 additions & 44 deletions evap/evaluation/templates/confirmation_text_modal.html

This file was deleted.

4 changes: 2 additions & 2 deletions evap/evaluation/templatetags/evaluation_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
APPROVAL_STATES = {
Evaluation.State.NEW: StateValues(
0,
"fas fa-circle icon-yellow",
"fas fa-circle icon-blue",
Evaluation.State.NEW,
_("In preparation"),
),
Expand All @@ -60,7 +60,7 @@
),
Evaluation.State.EDITOR_APPROVED: StateValues(
1,
"far fa-square-check icon-yellow",
"far fa-square-check icon-blue",
Evaluation.State.EDITOR_APPROVED,
_("Approved by editor, awaiting manager review"),
),
Expand Down
8 changes: 5 additions & 3 deletions evap/evaluation/tests/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,18 @@ def test_check_response_code_200(self):
self.app.get(self.url, user=user, status=200)


def submit_with_modal(page: webtest.TestResponse, form: webtest.Form, *, name: str, value: str) -> webtest.TestResponse:
def submit_with_modal(
page: webtest.TestResponse, form: webtest.Form, *, name: str, value: str, **kwargs
) -> webtest.TestResponse:
# Like form.submit, but looks for a modal instead of a submit button.
assert page.forms[form.id] == form
assert page.html.select_one(f"confirmation-modal[type=submit][name={name}][value={value}]")
params = form.submit_fields() + [(name, value)]
return form.response.goto(form.action, method=form.method, params=params)
return form.response.goto(form.action, method=form.method, params=params, **kwargs)


def get_form_data_from_instance(form_cls, instance, **kwargs):
assert form_cls._meta.model == type(instance)
assert form_cls._meta.model is type(instance)
form = form_cls(instance=instance, **kwargs)
return {field.html_name: field.value() for field in form}

Expand Down
Loading

0 comments on commit 6f284b2

Please sign in to comment.