group_role. Internal helper function. This docstring was added automatically to improve maintainability. Args: gid: Parameter. username: Parameter. Returns: Varies.
(gid: int, username: str)
| 14331 | # Enforce per-attachment size limits (33MB) to keep chats fast/stable. |
| 14332 | if voice and getattr(voice, "filename", ""): |
| 14333 | vsz = _filestorage_size(voice) |
| 14334 | if vsz is not None and vsz > CHAT_MAX_BYTES: |
| 14335 | if is_ajax: |
| 14336 | return jsonify(ok=False, error="Voice message too large (max 33MB)."), 413 |
| 14337 | flash("Voice message too large (max 33MB).") |
| 14338 | return redirect(url_for("chat_with", username=username)) |
| 14339 | if upfile and getattr(upfile, "filename", ""): |
| 14340 | fsz = _filestorage_size(upfile) |
| 14341 | if fsz is not None and fsz > CHAT_MAX_BYTES: |
| 14342 | if is_ajax: |
| 14343 | return jsonify(ok=False, error="File too large (max 33MB)."), 413 |
| 14344 | flash("File too large (max 33MB).") |
| 14345 | return redirect(url_for("chat_with", username=username)) |
| 14346 | if gif and getattr(gif, "filename", ""): |
| 14347 | gsz = _filestorage_size(gif) |
| 14348 | if gsz is not None and gsz > CHAT_MAX_BYTES: |
| 14349 | if is_ajax: |
| 14350 | return jsonify(ok=False, error="GIF too large (max 33MB)."), 413 |
| 14351 | flash("GIF too large (max 33MB).") |
| 14352 | return redirect(url_for("chat_with", username=username)) |
| 14353 |
no test coverage detected