Skip to content

Commit

Permalink
fix: add frappe version check
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Jul 20, 2023
1 parent cbdce3c commit ce1dc6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gameplan/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# Installation
# ------------

# before_install = "gameplan.install.before_install"
before_install = "gameplan.install.before_install"
after_install = "gameplan.install.after_install"

after_migrate = ["gameplan.search.build_index_in_background"]
Expand Down
9 changes: 9 additions & 0 deletions gameplan/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
from __future__ import unicode_literals
import frappe

def before_install():
check_frappe_version()

def after_install():
download_rembg_model()

def check_frappe_version():
from semantic_version import Version
from frappe import __version__ as frappe_version

if Version(frappe_version) < Version('15.0.0'):
raise SystemExit('Gameplan requires Frappe Framework version 15 or above')

def download_rembg_model():
from rembg import new_session
new_session()

0 comments on commit ce1dc6d

Please sign in to comment.