Skip to content

Commit

Permalink
Merge pull request #478 from MongoEngine/make-wtfforms-completely-opt…
Browse files Browse the repository at this point in the history
…ional

Make WTFForms completely optional
  • Loading branch information
insspb committed Jul 9, 2022
2 parents 6eb231e + b700e19 commit 2245a86
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions example_app/compose/flask/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM python:3.7-slim as dev

ENV PYTHONUNBUFFERED 1
RUN apt-get update && \
apt-get install git -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
RUN groupadd -r flask && useradd -r -g flask flask
COPY --chown=flask . /flask_mongoengine
RUN pip install --upgrade pip \
Expand Down
6 changes: 5 additions & 1 deletion flask_mongoengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from flask_mongoengine.json import override_json_encoder
from flask_mongoengine.pagination import *
from flask_mongoengine.sessions import *
from flask_mongoengine.wtf import db_fields

try:
from flask_mongoengine.wtf import db_fields
except ImportError:
from mongoengine import fields as db_fields


def current_mongoengine_instance():
Expand Down
1 change: 0 additions & 1 deletion flask_mongoengine/wtf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from flask_mongoengine.wtf.db_fields import * # noqa
from flask_mongoengine.wtf.orm import model_fields, model_form # noqa
2 changes: 1 addition & 1 deletion tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from mongoengine import NotUniqueError, queryset_manager
from werkzeug.datastructures import MultiDict

from flask_mongoengine.wtf import model_form
from flask_mongoengine.wtf.orm import model_form


def test_binaryfield(app, db):
Expand Down

0 comments on commit 2245a86

Please sign in to comment.