1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Added link to other space if user has both roles

This commit is contained in:
Mo 2021-11-29 20:49:18 +01:00
parent a4a835a5e7
commit 5a03a558c8
3 changed files with 20 additions and 12 deletions

View file

@ -1,4 +1,11 @@
{% macro information(current_user, userActiveSemester, role) %} {% macro information(current_user, userActiveSemester, role) %}
User: <a href="{{url_for('index')}}{{role}}/user/details/?id={{current_user.id}}">{{current_user.repr()}}</a>; Active User: <a href="{{url_for('index')}}{{role}}/user/details/?id={{current_user.id}}">{{current_user.repr()}}</a>
semester: {{userActiveSemester(flashWarning=True).repr()}}.
| Active semester: {{userActiveSemester(flashWarning=True).repr()}}
{% if (role == "admin") and (current_user.has_role("assistant")) %}
| <a href="{{url_for('index')}}assistant">Assistant space</a>.
{% elif (role == "assistant") and (current_user.has_role("admin")) %}
| <a href="{{url_for('index')}}admin">Admin space</a>.
{% endif %}
{% endmacro %} {% endmacro %}

11
poetry.lock generated
View file

@ -340,14 +340,14 @@ python-versions = "*"
[[package]] [[package]]
name = "rope" name = "rope"
version = "0.19.0" version = "0.22.0"
description = "a python refactoring library..." description = "a python refactoring library..."
category = "dev" category = "dev"
optional = false optional = false
python-versions = "*" python-versions = "*"
[package.extras] [package.extras]
dev = ["pytest"] dev = ["build", "pytest", "pytest-timeout"]
[[package]] [[package]]
name = "sqlalchemy" name = "sqlalchemy"
@ -424,8 +424,8 @@ email = ["email-validator"]
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.9" python-versions = "^3.10"
content-hash = "cbd384282803742bf8329353f02d15b5512c5ce72eb075cc1c3158045b9e50df" content-hash = "7af5fe05c787894cba9c757b0d2838f6fe365e340e36cb841ce40dbccfd5431f"
[metadata.files] [metadata.files]
black = [ black = [
@ -725,7 +725,8 @@ regex = [
{file = "regex-2021.11.10.tar.gz", hash = "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6"}, {file = "regex-2021.11.10.tar.gz", hash = "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6"},
] ]
rope = [ rope = [
{file = "rope-0.19.0.tar.gz", hash = "sha256:64e6d747532e1f5c8009ec5aae3e5523a5bcedf516f39a750d57d8ed749d90da"}, {file = "rope-0.22.0-py3-none-any.whl", hash = "sha256:2847220bf72ead09b5abe72b1edc9cacff90ab93663ece06913fc97324167870"},
{file = "rope-0.22.0.tar.gz", hash = "sha256:b00fbc064a26fc62d7220578a27fd639b2fad57213663cc396c137e92d73f10f"},
] ]
sqlalchemy = [ sqlalchemy = [
{file = "SQLAlchemy-1.4.27-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:6afa9e4e63f066e0fd90a21db7e95e988d96127f52bfb298a0e9bec6999357a9"}, {file = "SQLAlchemy-1.4.27-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:6afa9e4e63f066e0fd90a21db7e95e988d96127f52bfb298a0e9bec6999357a9"},

View file

@ -6,18 +6,18 @@ authors = ["Mohamad Bitar <mohamad.bit@protonmail.com>"]
readme = "README.md" readme = "README.md"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.9" python = "^3.10"
Flask = ">=2.0.1" Flask = ">=2.0.2"
Flask-SQLAlchemy = ">=2.5.1" Flask-SQLAlchemy = ">=2.5.1"
Flask-WTF = ">=0.15.1" Flask-WTF = ">=1.0.0"
Flask-Security-Too = ">=4.0.1" Flask-Security-Too = ">=4.1.2"
Flask-Admin = ">=1.5.8" Flask-Admin = ">=1.5.8"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
flake8 = "*" flake8 = "*"
black = "*" black = "*"
isort = "*" isort = "*"
rope = "^0.19.0" rope = "*"
[build-system] [build-system]
requires = ["poetry-core>=1.0.0"] requires = ["poetry-core>=1.0.0"]