Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 264883d

Browse files
committed
Merge branch 'master' of github.com:RunestoneInteractive/RunestoneServer
2 parents bfbe28c + 7fb6351 commit 264883d

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

docker/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Open a Terminal. In the Terminal:
4242

4343
#. Edit ``/etc/paths``; add ``/opt/homebrew/bin`` as the first line in that file.
4444
#. `Install Homebrew <https://brew.sh/#install>`_.
45-
#. Execute ``brew install python docker``.
45+
#. Execute ``brew install python docker md5sha1sum``.
4646
#. Run the newly-installed Docker Desktop application.
4747

4848
.. note::

docker/gunicorn_config/fastapi_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
wsgi_app = "bookserver.main:app"
3434

3535
# `workers <https://docs.gunicorn.org/en/stable/settings.html#workers>`_: The number of worker processes for handling requests. Pick this based on CPU count.
36-
workers = multiprocessing.cpu_count() * 2 + 1
36+
if os.environ["BOOK_SERVER_CONFIG"] == "development":
37+
workers = 4
38+
else:
39+
workers = multiprocessing.cpu_count() * 2 + 1
3740

3841
# `worker_class <https://docs.gunicorn.org/en/stable/settings.html#worker-class>`_: The type of workers to use. Use `uvicorn's worker class for gunicorn <https://www.uvicorn.org/deployment/#gunicorn>`_.
3942
worker_class = "uvicorn.workers.UvicornWorker"

docker/gunicorn_config/web2py_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
wsgi_app = "wsgihandler:application"
3333

3434
# `workers <https://docs.gunicorn.org/en/stable/settings.html#workers>`_: The number of worker processes for handling requests. Pick this based on CPU count.
35-
workers = multiprocessing.cpu_count()
35+
if os.environ["BOOK_SERVER_CONFIG"] == "development":
36+
workers = 4
37+
else:
38+
workers = multiprocessing.cpu_count()
3639

3740
# `bind <https://docs.gunicorn.org/en/stable/settings.html#bind>`_: The socket to bind. This must match the socket nginx sends to.
3841
bind = "unix:/run/web2py.sock"

rsmanage/rsmanage.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -827,22 +827,28 @@ def studentinfo(config, student):
827827
student = click.prompt("Student Id: ")
828828

829829
res = eng.execute(
830+
## Index 0 1 2 3 4 5 6
830831
f"""
831-
select auth_user.id, first_name, last_name, email, courses.course_name, courses.id
832-
from auth_user join user_courses ON user_courses.user_id = auth_user.id
832+
select auth_user.id, first_name, last_name, email, courses.course_name, courses.id, payments.charge_id
833+
from auth_user
834+
join user_courses on user_courses.user_id = auth_user.id
835+
full outer join payments on user_courses.id = payments.user_courses_id
833836
join courses on courses.id = user_courses.course_id where username = '{student}'"""
834837
)
835838
# fetchone fetches the first row without closing the cursor.
836839
first = res.fetchone()
837-
print("id\tFirst\tLast\temail")
838-
print("\t".join(str(x) for x in first[:4]))
839-
print("")
840-
print(" Course cid")
841-
print("--------------------------")
842-
print(f"{first[-2].rjust(15)} {str(first[-1]).rjust(10)}")
843-
if res:
840+
if first:
841+
print("id\tFirst\tLast\temail")
842+
print("\t".join(str(x) for x in first[:4]))
843+
print("")
844+
print("Course cid")
845+
print("----------------------------------- ----------")
846+
print(f"{first[4].ljust(35)} {str(first[5]).rjust(10)} {first[6] if first[6] is not None else ''}")
844847
for row in res:
845-
print(f"{row[-2].rjust(15)} {str(row[-1]).rjust(10)}")
848+
print(f"{row[4].ljust(35)} {str(row[5]).rjust(10)} {row[6] if row[6] is not None else ''}")
849+
print("\n")
850+
else:
851+
print("Student not found.")
846852

847853

848854
@cli.command()

views/peer/student.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ <h2></h2>
3030
{{pass}}
3131
</table>
3232

33-
<p><b>Note:</b> The "After Class" version of the assignment is only for use outside of and AFTER the class it was introduced. You will be able to vote for each question twice and review a chat trascript from a group that was recorded during class.</p>
33+
<p><b>Note:</b> The "After Class" version of the assignment is only for use outside of and AFTER the class it was introduced. You will be able to vote for each question twice and review a chat transcript from a group that was recorded during class.</p>

0 commit comments

Comments
 (0)