Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promotion automatique des modérateurs #6

Merged
merged 24 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
39a53b6
removes cffi and chardet from pyproject.toml
azmeuk Jul 11, 2023
f5a80f8
Update dependencies for docker containers
LoanR Jul 17, 2023
af74399
chore: bump to flask-webtest 0.1.3
azmeuk Jul 19, 2023
f8a4268
test: added pytest-flask dev dependency
azmeuk Jul 19, 2023
2cf98e1
test: avoid using app_context in unit tests
azmeuk Jul 19, 2023
cd9a914
chore: bump to flask-wtf 1.1.1
azmeuk Jul 19, 2023
53a90fa
refactor: add a name to the flask blueprint
azmeuk Jul 19, 2023
93cb3c8
chore: ensure flask version stays under 2.3
azmeuk Jul 19, 2023
c6cd3bd
test: use webtest instead of the default flask test client
azmeuk Jul 19, 2023
95d1b0c
chore: bump to pytest-cov 4.1.0
azmeuk Jul 19, 2023
4ede645
chore: bump to pytest 7.4.0
azmeuk Jul 19, 2023
c4d0b2f
chore: bump to pytest-mock 3.11.1
azmeuk Jul 19, 2023
8761f3c
refactor: force type in URL parameters
azmeuk Jul 20, 2023
f23508b
refactor: user_id field in JoinMeetingForm is an integer
azmeuk Jul 20, 2023
2c2f2f0
refactor: move authenticated_attendee fixture in conftest.py
azmeuk Jul 20, 2023
e6ed6a7
refactor: use the meeting fixture in unit tests
azmeuk Jul 20, 2023
2ca8b64
chore: bump to flask-pyoidc 3.14.2
azmeuk Jul 20, 2023
0f4386f
test: use webtest `status_code` parameter to check status codes
azmeuk Jul 20, 2023
b956ea0
refactor: implement `has_user_session` utility
azmeuk Jul 20, 2023
4e83406
feat: meeting owner are always promoted moderators when authenticated
azmeuk Jul 20, 2023
dc8bd7f
fix: user is always passed in the jinja contexts
azmeuk Jul 21, 2023
d854c65
feat: add a signin button on the meeting join page
azmeuk Jul 21, 2023
58228f4
feat: the login button becomes a text
azmeuk Jul 28, 2023
4e27ba0
style: black
azmeuk Jul 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
386 changes: 220 additions & 166 deletions poetry.lock

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
cffi = "1.14.0"
chardet = "3.0.4"
flask-pyoidc = "3.10.0"
flask-pyoidc = "^3.14.2"
flask-sqlalchemy = "^3.0.3"
flask-uploads = "0.2.1"
flask-migrate = "3.1.0"
Expand All @@ -23,26 +21,27 @@ webdavclient3 = "3.14.6"
filetype = "^1.2.0"
flask-babel = "2.0.0"
celery = "5.2.7"
flask = "2.2.5"
flask = "<2.3"
flask-caching = "^2.0.2"
flask-wtf = "1.0.1"
flask-wtf = "^1.1.1"
redis = "4.4.4"
requests = "^2.27.1"
werkzeug = "^2.3.4"
werkzeug = "<2.3"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.2"
pytest-mock = "^3.10.0"
Flask-WebTest = "^0.1.1"
pytest = "^7.4.0"
pytest-mock = "^3.11.1"
Flask-WebTest = "^0.1.3"
freezegun = "^1.2.2"
black = "^23.1.0"
flake8 = "^6.0.0"
pre-commit = "^3.1.1"
pytest-cov = "^4.0.0"
pytest-cov = "^4.1.0"
pytest-dotenv = "^0.5.2"
pytest-flask = "^1.2.0"
coverage = "^7.2.2"

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion web/flaskr/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JoinMeetingAsRoleForm(Form):
class JoinMeetingForm(FlaskForm):
fullname = StringField()
meeting_fake_id = StringField()
user_id = StringField()
user_id = IntegerField()
h = StringField()
fullname_suffix = StringField()

Expand Down
12 changes: 7 additions & 5 deletions web/flaskr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def get_join_url(self, meeting_role, fullname, fullname_suffix="", create=False)
)
return self.bbb.prepare_request_to_join_bbb(meeting_role, nickname).url
return url_for(
"waiting_meeting",
"routes.waiting_meeting",
meeting_fake_id=self.fake_id,
user_id=self.user.id,
h=self.get_hash(meeting_role),
Expand All @@ -722,7 +722,7 @@ def get_join_url(self, meeting_role, fullname, fullname_suffix="", create=False)

def get_signin_url(self, meeting_role):
return current_app.config["SERVER_FQDN"] + url_for(
"signin_meeting",
"routes.signin_meeting",
meeting_fake_id=self.fake_id,
user_id=self.user.id,
h=self.get_hash(meeting_role),
Expand All @@ -740,7 +740,7 @@ def get_mail_signin_url(self):
] # remove milliseconds
hash_param = self.get_mail_signin_hash(self.fake_id, expiration)
return current_app.config["SERVER_FQDN"] + url_for(
"signin_mail_meeting",
"routes.signin_mail_meeting",
meeting_fake_id=self.fake_id,
expiration=expiration,
h=hash_param,
Expand All @@ -767,8 +767,10 @@ def get_data_as_dict(self, fullname, fetch_recording=False):
d["attendee_join_url"] = self.get_join_url("attendee", fullname)
return d

def get_role(self, hashed_role):
if self.get_hash("attendee") == hashed_role:
def get_role(self, hashed_role, user_id=None):
if user_id and self.user.id == user_id:
return "moderator"
elif self.get_hash("attendee") == hashed_role:
role = "attendee"
elif self.get_hash("moderator") == hashed_role:
role = "moderator"
Expand Down
Loading
Loading