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

Release 3 #258

Merged
merged 377 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
377 commits
Select commit Hold shift + click to select a range
b91b842
adminpanel theme + tests (#177)
masinnae May 10, 2024
cc3f1f7
Groups (#182)
miboelae May 10, 2024
2eaa2ee
test
masinnae May 10, 2024
f2e4954
theme
masinnae May 8, 2024
59694bf
test
masinnae May 10, 2024
88f3e6d
Merge remote-tracking branch 'origin/projectpage_testen' into project…
masinnae May 10, 2024
36da93a
names switch
masinnae May 10, 2024
7a66c51
Merge remote-tracking branch 'origin/projectpage_testen' into project…
masinnae May 10, 2024
87deb20
requirements card
pieterjanin May 10, 2024
167f6e7
frontend testen + locale fix
masinnae May 10, 2024
cd462c2
project sidebar test
masinnae May 10, 2024
8d7b10e
needhelpbutton test
masinnae May 10, 2024
db4087e
linter
masinnae May 10, 2024
f952f8b
format
masinnae May 10, 2024
4b1bf8e
fixes #189
pieterjanin May 11, 2024
e875831
beter zo
pieterjanin May 11, 2024
7b924f1
fix: #187
reyniersbram May 11, 2024
c9c7848
wip
pieterjanin May 11, 2024
54947bf
custom docker image tests
pieterjanin May 11, 2024
ff04755
handle docker run crashes
pieterjanin May 11, 2024
09a3890
autopep
pieterjanin May 11, 2024
203e529
fix test 1
pieterjanin May 11, 2024
340fdbe
fix tests 2
pieterjanin May 11, 2024
4622b54
Implement show all students in groups
miboelae May 11, 2024
20e1feb
allow admin to set own teacher permissions
reyniersbram May 12, 2024
5f53855
delete user (frontend)
reyniersbram May 12, 2024
e996282
delete user (frontend)
reyniersbram May 12, 2024
2653241
delete user (backend)
reyniersbram May 12, 2024
7ab6ba1
Merge branch 'admin-changes' of github.com:SELab-2/UGent-5 into admin…
reyniersbram May 12, 2024
dd7e3ae
Add surname of users (#179)
reyniersbram May 12, 2024
b9026b6
cleanup test style
pieterjanin May 12, 2024
cd2f678
fix test runner
pieterjanin May 12, 2024
8c66220
autopep
pieterjanin May 12, 2024
74a999c
forcerm
pieterjanin May 12, 2024
b0885c0
???
pieterjanin May 12, 2024
e7f81f6
handle container create fail
pieterjanin May 12, 2024
4b5b407
pyright
pieterjanin May 12, 2024
aee21d4
prune
pieterjanin May 12, 2024
0f38bdf
rm prune
pieterjanin May 12, 2024
9ada42e
prune 2
pieterjanin May 12, 2024
9e83587
prune 3
pieterjanin May 12, 2024
78d3436
prune weer weg, zou in orde moeten zijn
pieterjanin May 12, 2024
988e831
button size
masinnae May 12, 2024
c7646d0
add tags for container management
pieterjanin May 12, 2024
6e47417
Merge pull request #195 from SELab-2/admin-changes
masinnae May 13, 2024
9921405
Merge pull request #191 from SELab-2/default-theme
masinnae May 13, 2024
c073444
Merge pull request #188 from SELab-2/projectpage_testen
masinnae May 13, 2024
73c3b94
navigation button to admin fix (#197)
masinnae May 13, 2024
1a9e2e1
Merge pull request #194 from SELab-2/group-enhancement
miboelae May 13, 2024
c4f0e3e
test + internationalization + stling
masinnae May 13, 2024
ba316a1
Implement isTeacher correctly
miboelae May 14, 2024
7b6d2d3
implement surname where needed
miboelae May 14, 2024
ca0d2df
test fixes
miboelae May 14, 2024
8b9ec1d
test fixes x2
miboelae May 14, 2024
7718cf7
reroute whenever leaving/joining group
miboelae May 14, 2024
ce3fdac
Merge remote-tracking branch 'origin/dev' into subjects
mattiscauwel May 14, 2024
5139deb
is teacher for new subject button visibility
mattiscauwel May 14, 2024
85f1fd4
buttons now only appearing when isTeacher/isInstructor
mattiscauwel May 14, 2024
f202e37
deleted announcements
mattiscauwel May 14, 2024
ba56e7a
removed intern skeleton loaders
mattiscauwel May 14, 2024
642da2e
fixed pylint docker
mattiscauwel May 14, 2024
7876d5d
found another skeleton loader
mattiscauwel May 14, 2024
6652cfb
styling
masinnae May 15, 2024
2272979
Merge pull request #202 from SELab-2/group_enhancement
masinnae May 15, 2024
7284d0b
styling
masinnae May 15, 2024
9caac36
Merge remote-tracking branch 'origin/groupspage_restylen' into groups…
masinnae May 15, 2024
7a0c885
groups page styling
masinnae May 15, 2024
ca25cf9
group page style + redirects
masinnae May 15, 2024
a2e1773
refactored components structure and added icons for student/teacher s…
mattiscauwel May 15, 2024
34547eb
made subjecticon component
mattiscauwel May 15, 2024
f86b7eb
deleted non used css class
mattiscauwel May 15, 2024
d47464a
test setup
masinnae May 15, 2024
6d56e63
Merge pull request #200 from SELab-2/isTeacherChanges
masinnae May 15, 2024
3fb2824
Merge branch 'groupspage_restylen' into isTeacherChanges
masinnae May 15, 2024
052a3e4
Merge pull request #208 from SELab-2/isTeacherChanges
masinnae May 15, 2024
2d1fe9a
oké rebase werkt eindelijk
masinnae May 15, 2024
40269ee
merge dev
pieterjanin May 15, 2024
e13df2d
move tests for consistency
pieterjanin May 15, 2024
b19ae62
groupsview frontend test
masinnae May 15, 2024
b4df234
frontend testen
masinnae May 15, 2024
b4c5b50
Merge branch 'dev' into groupspage_restylen
masinnae May 15, 2024
0e622a9
format
masinnae May 15, 2024
cfa21bb
file extension warnings
pieterjanin May 15, 2024
4cd02db
reroute whenever leaving/joining group
miboelae May 15, 2024
b52ba9f
cleanup
pieterjanin May 15, 2024
aabffa8
tests
pieterjanin May 15, 2024
ed6f94b
fix backend tests
pieterjanin May 15, 2024
86c290b
formatter
pieterjanin May 15, 2024
1eaf473
Merge pull request #210 from SELab-2/group_button_project
miboelae May 16, 2024
a499dfc
Merge remote-tracking branch 'origin/dev' into subjects
mattiscauwel May 16, 2024
d2fe9fd
deleted tooltip + last refactoring before pull request
mattiscauwel May 16, 2024
0ec895e
npm run format
mattiscauwel May 16, 2024
6ba4abd
refactored utils.py
mattiscauwel May 16, 2024
208c432
Query refactor (#152)
reyniersbram May 16, 2024
8be06ae
refactored utils.py 2
mattiscauwel May 16, 2024
a091556
Merge remote-tracking branch 'origin/dev' into subjects
mattiscauwel May 16, 2024
ce9d154
solved merge conflicts
mattiscauwel May 16, 2024
441af9a
fixed i18n
mattiscauwel May 16, 2024
6c1028a
run formater, linter
mattiscauwel May 16, 2024
fe2e99b
refactored subject list into object with role
mattiscauwel May 16, 2024
1a5d3df
changing icon on subjects page (ugly solution bug with enums)
mattiscauwel May 16, 2024
a553cae
working on showing icon on subject page
mattiscauwel May 16, 2024
4f9ca8e
fixed subject uuid query + user
mattiscauwel May 16, 2024
4b1e183
Merge branch 'subjects' into subject_instructor_student_filter
mattiscauwel May 16, 2024
1cf0bf1
linter + reformat
mattiscauwel May 16, 2024
720aa78
Projectspage testen + styling (#198)
masinnae May 17, 2024
5430729
fix bug login not working on first ever login
reyniersbram May 17, 2024
2a737f7
Merge pull request #199 from SELab-2/info_page_testen
miboelae May 17, 2024
a813608
Merge pull request #215 from SELab-2/surname-on-login
miboelae May 17, 2024
538c357
vuetify 3.5
pieterjanin May 17, 2024
3c5bfbb
merge dev
pieterjanin May 17, 2024
e50127b
package lock
pieterjanin May 17, 2024
0d36528
undo backend response change
pieterjanin May 17, 2024
0561d52
undo backend response change
pieterjanin May 17, 2024
6f3ff78
Merge branch 'dev' into groupspage_restylen
reyniersbram May 17, 2024
cd5f3b8
register link button permissions
mattiscauwel May 17, 2024
f7a465a
removed deleted import
mattiscauwel May 17, 2024
994e46a
fixed id icons
mattiscauwel May 17, 2024
1f1aa55
fixed subject filter buttons
mattiscauwel May 17, 2024
9b934cb
surname appears in subject header card
mattiscauwel May 17, 2024
b2d9ef3
fixed some wishful filter behavior and no results
mattiscauwel May 17, 2024
1607ae0
added i18n
mattiscauwel May 17, 2024
0df4511
fixed project title styling
mattiscauwel May 17, 2024
ab6db08
added quil
mattiscauwel May 17, 2024
b208d89
fixed registerlinkbutton
mattiscauwel May 17, 2024
99d9e88
deleted radius corners
mattiscauwel May 17, 2024
8eeb57a
run linter
mattiscauwel May 17, 2024
5d54fc6
run linter
mattiscauwel May 17, 2024
79932fe
refactored utils.py
mattiscauwel May 17, 2024
6ff26f5
custom fetcherror + group fix
pieterjanin May 18, 2024
34f57a6
status weg
pieterjanin May 18, 2024
6460c32
fix tests
masinnae May 18, 2024
e7de74e
Merge pull request #209 from SELab-2/groupspage_restylen
masinnae May 18, 2024
4319c1f
admin symbol when not student or instructor + fix edit subject button…
mattiscauwel May 18, 2024
4ad4aea
fix student not allowed icon
mattiscauwel May 18, 2024
b8c2fd1
linter
mattiscauwel May 18, 2024
63d1a04
useProjectGroupQuery zoals in #214
pieterjanin May 18, 2024
efa1969
changed emits
mattiscauwel May 18, 2024
1c7e4ae
fix width issue
pieterjanin May 18, 2024
f479b6d
implemented requested pr changes
mattiscauwel May 18, 2024
b499069
run linter formater
mattiscauwel May 18, 2024
c4eb449
Merge remote-tracking branch 'origin/dev' into create_subject
mattiscauwel May 18, 2024
7a4642d
Homescreen deadlines (#214)
reyniersbram May 18, 2024
3e35231
added router to create SubjectsView.vue
mattiscauwel May 18, 2024
f30e6e7
merge dev
pieterjanin May 18, 2024
4af656d
fix width issue fr
pieterjanin May 18, 2024
ac97ec7
added first form elements
mattiscauwel May 18, 2024
8cc45ae
fixed academic year
mattiscauwel May 18, 2024
ce8f2ca
Merge branch 'subjects' into create_subject
mattiscauwel May 18, 2024
8840136
remove announcements
masinnae May 18, 2024
624f6cf
frontend testen
masinnae May 18, 2024
a563492
added submit button
mattiscauwel May 18, 2024
1ff5dbc
Fix projects page (#219)
pieterjanin May 18, 2024
e253b20
add instructor surname
masinnae May 18, 2024
ac1963a
format
masinnae May 18, 2024
c9171ed
create subject via frontend works
mattiscauwel May 18, 2024
8948cdd
fix: patch requirements
xerbalind May 18, 2024
c948aec
Submission list voor een vak leerkracht of assistent (#190)
xerbalind May 18, 2024
ce713aa
implemented search
mattiscauwel May 18, 2024
6082df3
Move submissions list to group page
xerbalind May 18, 2024
b62cde6
add users to instructors
mattiscauwel May 18, 2024
3cc9c31
assign and delete users from instructors
mattiscauwel May 18, 2024
2fac134
sort instructors
mattiscauwel May 18, 2024
d301892
Merge pull request #169 from SELab-2/subjects
mattiscauwel May 18, 2024
e9c53a5
import
pieterjanin May 18, 2024
83e4046
import
pieterjanin May 18, 2024
b0e54a0
Merge branch 'dev' into submit-file-ext
pieterjanin May 18, 2024
13fce2a
Merge pull request #222 from SELab-2/requirements_patch_fix
pieterjanin May 18, 2024
5da86fb
begin styling create subject page
mattiscauwel May 18, 2024
e7d45c9
more styling
mattiscauwel May 19, 2024
90c9428
adding instsructors
mattiscauwel May 19, 2024
c25c746
remove instructors
mattiscauwel May 19, 2024
8344ed6
assign yourself button works
mattiscauwel May 19, 2024
cdfd01a
emit cleanup
mattiscauwel May 19, 2024
3affccc
emitted events fixed
mattiscauwel May 19, 2024
9cd62a8
add instructors to db
mattiscauwel May 19, 2024
6c45374
form validation
mattiscauwel May 19, 2024
4e30a39
implemented dialog
mattiscauwel May 19, 2024
9ccfdac
404 not found + register to subject view: sytling + frontend tests (#…
masinnae May 19, 2024
9e9c729
added i18n
mattiscauwel May 19, 2024
b8d9398
Merge remote-tracking branch 'origin/dev' into create_subject
mattiscauwel May 19, 2024
f2ce8e1
i18n bug fixed
mattiscauwel May 19, 2024
c84a23c
styling details
mattiscauwel May 19, 2024
643819f
redirect after hitting confirm
mattiscauwel May 19, 2024
b23d72f
lint + format
mattiscauwel May 19, 2024
3b90f95
Merge pull request #223 from SELab-2/merge_submissions
masinnae May 19, 2024
3280435
Groep nummer ipv id (#221)
xerbalind May 19, 2024
1383e41
merge dev
pieterjanin May 19, 2024
e27f86e
subjects overflow fix
mattiscauwel May 20, 2024
3e5815b
subject title card scrollable
mattiscauwel May 20, 2024
041a594
scrolling on overflow
mattiscauwel May 20, 2024
587d478
added v-chips and sorted instructors on subjectpage
mattiscauwel May 20, 2024
ae718d5
format + linter
mattiscauwel May 20, 2024
aa82fd6
style rollback subjects voor marieke
mattiscauwel May 20, 2024
850b2c0
linter format
mattiscauwel May 20, 2024
1d15183
deleted bg container on create page for better designing patch
mattiscauwel May 20, 2024
76d4d50
last changes on create subject
mattiscauwel May 20, 2024
df4b10b
Merge branch 'dev' into homescreen-testen
DRIESASTER May 20, 2024
4ebf970
sort voor bram
DRIESASTER May 20, 2024
163396f
testfix na query aanpassing
masinnae May 20, 2024
8da6c94
Merge pull request #220 from SELab-2/homescreen-testen
masinnae May 20, 2024
621488b
fix: #229
reyniersbram May 20, 2024
8ad2c55
fix tests
reyniersbram May 20, 2024
8f80b01
Merge pull request #230 from SELab-2/homescreen-subjects
pieterjanin May 20, 2024
d153df5
Merge pull request #193 from SELab-2/custom-docker-tests
pieterjanin May 20, 2024
fd91c2c
Merge pull request #211 from SELab-2/submit-file-ext
pieterjanin May 20, 2024
4f66dbf
Download alle indieningen (files) + csv (met indieningen info) in 1 k…
xerbalind May 20, 2024
f64161c
grouppagina en submissions testen + styling (#224)
masinnae May 20, 2024
5c81f03
allow teachers to get all users (#231)
reyniersbram May 20, 2024
5004b36
email and email rules
mattiscauwel May 21, 2024
63dcdff
added watcher
mattiscauwel May 21, 2024
3f8443e
added emits
mattiscauwel May 21, 2024
dcd6460
post mail fully functional
mattiscauwel May 21, 2024
349ffd6
removed on search loaded
mattiscauwel May 21, 2024
3768703
format linter
mattiscauwel May 21, 2024
a436136
update mutations for create subject
reyniersbram May 21, 2024
4b102c3
Merge remote-tracking branch 'origin/subjects' into subjects
mattiscauwel May 21, 2024
f590e51
Edit project (#196)
DRIESASTER May 21, 2024
9827c55
Update README.md
pieterjanin May 21, 2024
49bfb36
Update README.md
pieterjanin May 21, 2024
040df39
fix broken link
pieterjanin May 21, 2024
079fef9
Merge pull request #237 from SELab-2/broken-link
pieterjanin May 21, 2024
987a12e
Merge pull request #227 from SELab-2/subjects
mattiscauwel May 21, 2024
9ee3b67
Search users with throttle (#236)
reyniersbram May 22, 2024
34d3314
algemene styling van website (#226)
masinnae May 22, 2024
889e485
Permission checks for pages (#166)
reyniersbram May 22, 2024
7692926
Submissions teacher testen (#238)
masinnae May 22, 2024
e84929e
fix group id showing instead of num
reyniersbram May 22, 2024
2252592
Revert "fix group id showing instead of num"
reyniersbram May 22, 2024
cdd7aef
Bug fixes (#243)
xerbalind May 22, 2024
a2f5dc1
Merge branch 'main' into dev
reyniersbram May 22, 2024
ba1214e
Patch subject (#240)
mattiscauwel May 23, 2024
75ee5aa
some final details (#245)
masinnae May 23, 2024
87dc0f5
publish date checks
DRIESASTER May 23, 2024
c237e99
publish date checks
DRIESASTER May 23, 2024
02b6ca9
fix #246 tests: docker 7.0.0 -> 7.1.0 (#251)
pieterjanin May 23, 2024
9c92dba
Bump requests from 2.31.0 to 2.32.2 in /backend (#246)
dependabot[bot] May 23, 2024
ebc542a
fix route to submission page + fix teacher submissions page if capaci…
masinnae May 23, 2024
a9af760
publish date checks (#249)
DRIESASTER May 23, 2024
adcc5a4
Revert "publish date checks (#249)" (#253)
reyniersbram May 23, 2024
5d498d6
lol
DRIESASTER May 23, 2024
a51235c
lol
DRIESASTER May 23, 2024
d4c32c1
create files to use in demo
reyniersbram May 23, 2024
557414e
fixes remove user cascading on groups/subjects/... (#250)
miboelae May 23, 2024
47ae91a
Ugent logo (#252)
masinnae May 23, 2024
7c96de6
extra validatie
DRIESASTER May 23, 2024
e03f50d
test adjusted for publish date addition
DRIESASTER May 23, 2024
dea50b8
Merge pull request #255 from SELab-2/demo-files
pieterjanin May 23, 2024
1efaf42
Groupfixes (#254)
DRIESASTER May 23, 2024
171cd65
Merge pull request #247 from SELab-2/publish_date
pieterjanin May 23, 2024
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
61 changes: 45 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,55 @@
# UGent-5
# Apollo

## Rolverdeling
Apollo is an online submission platform where instructors can flexibly set requirements for
student submissions. These requirements can range from simple checks on the submitted
file structure to test scripts that run when a submission is made.

| Rol | Verantwoordelijke |
| ------------- | ------------- |
| Groepsleider | Marieke Sinnaeve |
| Technische lead | Bram Reyniers |
| Systeembeheerder | Xander Bil |
| Customer Relations Officer | Pieter Janin |
| Frontendbeheerder | Mattis Cauwel |
| Backendbeheerder | Dries Huybens |
| Documentatiebeheerder | Pieter Janin |
| Testbeheerder | Michaël Boelaert |
Students quickly receive feedback on their submission, allowing them to know if it meets
the project requirements.

This repository hosts the web application's source code. To use Apollo, visit https://sel2-5.ugent.be.

## Wiki

Informatie over de gebruikte technologieën, de gebruikershandleiding en meer kan je vinden in de [wiki](https://github.com/SELab-2/UGent-5/wiki).
Documentation, including a user manual for teachers, can be found in the
[Apollo wiki](https://github.com/SELab-2/UGent-5/wiki).

## For Developers

## Setup ontwikkelomgeving
Instructions for setting up the frontend development environment can be found
[here](frontend/README.md).

De instructies voor het opzetten van de ontwikkelomgeving van de frontend kan je [hier](frontend/README.md) vinden. De instructies voor de backend staan [hier](backend/REAMDE.md).
Instructions for the backend are located [here](backend/README.md).

## API

Geautomatiseerde clients kunnen interageren met de webapplicatie via de [API](https://sel2-5.ugent.be/api/docs).
Automated clients can interact with the web application via the [API](https://sel2-5.ugent.be/api/docs).

## Used tools and frameworks

### Database
- Database system: [PostgreSQL](https://www.postgresql.org/)
- Database migrations: [alembic](https://github.com/sqlalchemy/alembic).

### Backend
- Backend framework: [FastAPI](https://fastapi.tiangolo.com/)
- Database interface: [SQLAlchemy](https://www.sqlalchemy.org/)
- JSON-validation: [Pydantic](https://github.com/pydantic/pydantic)
- Test framework: [pytest](https://github.com/pytest-dev/pytest)

### Frontend
- Frontend framework: [Vue.js](https://vuejs.org/) (Composition API) + [TypeScript](https://www.typescriptlang.org/)
- Component library: [Vuetify](https://dev.vuetifyjs.com/en/)
- Test framework: [Vitest](https://vitest.dev/)

## The team

| | |
|------------------|---------------------------------------------------|
| Xander Bil | System Administrator |
| Michaël Boelaert | Test Manager |
| Mattis Cauwel | Frontend Manager |
| Dries Huybens | Backend Manager |
| Pieter Janin | Customer Relations Officer, Documentation Manager |
| Bram Reyniers | Technical Lead |
| Marieke Sinnaeve | Team Lead |
4 changes: 3 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```sh
# Create a python virtual environment
python -m venv venv
python3.12 -m venv venv
# Activate the environment
source venv/bin/activate
# Install dependencies
Expand Down Expand Up @@ -71,6 +71,8 @@ DATABASE_URI="postgresql://username:password@localhost:5432/dbname"
alembic upgrade head
```

You can find more info about alembic [here](alembic/README.md).

#### Managing the database
```sh
# Stop the database container
Expand Down
1 change: 0 additions & 1 deletion backend/alembic/README

This file was deleted.

43 changes: 43 additions & 0 deletions backend/alembic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Alembic

From the docs:

> [Alembic](https://alembic.sqlalchemy.org/en/latest/) is a lightweight database
migration tool for usage with the [SQLAlchemy](https://www.sqlalchemy.org/)
Database Toolkit for Python.

It allows us to generate database schemas from Python SQLAlchemy code, found in each
`models.py` file.

## Usage

Here are some of the most commonly used commands you might need.

#### Automatically generate a revision script after modifying database models in Python:

```sh
alembic revision --autogenerate -m "my_revision_name"
```

Make sure to review the generated script in `alembic/versions`
and make adjustments if needed.

#### Run a migration: this will upgrade the database schema to the most recent revision.

```sh
alembic upgrade head
```

#### Undo the most recent revision:

```sh
alembic downgrade -1
```

#### Reset the database to its initial (empty) state:

```sh
alembic downgrade base
```

For more examples, see the [official Alembic tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html).
35 changes: 35 additions & 0 deletions backend/alembic/versions/18fb90307213_project_requirements_fix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""project_requirements_fix: fixes bug where project requirements would remain in the database after the parent
project would be deleted.

Revision ID: 18fb90307213
Revises: e0c97995e669
Create Date: 2024-05-04 15:42:43.114843

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '18fb90307213'
down_revision: Union[str, None] = 'e0c97995e669'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('requirement', 'project_id',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('requirement', 'project_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
31 changes: 31 additions & 0 deletions backend/alembic/versions/566f33fb161f_add_user_surname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add user surname

Revision ID: 566f33fb161f
Revises: 18fb90307213
Create Date: 2024-05-06 15:32:33.617263

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '566f33fb161f'
down_revision: Union[str, None] = '18fb90307213'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('website_user', sa.Column('surname', sa.String(),
nullable=False, server_default='SURNAME_DEFAULT'))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('website_user', 'surname')
# ### end Alembic commands ###
44 changes: 44 additions & 0 deletions backend/alembic/versions/937c04aa37a1_add_group_num_column.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""add group num column

Revision ID: 937c04aa37a1
Revises: 566f33fb161f
Create Date: 2024-05-18 18:09:30.734349

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "937c04aa37a1"
down_revision: Union[str, None] = "566f33fb161f"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"team", sa.Column("num", sa.Integer(), nullable=False, server_default="0")
)
op.drop_column("team", "team_name")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"team",
sa.Column(
"team_name",
sa.VARCHAR(),
autoincrement=False,
nullable=False,
server_default="DEFAULT_GROUP_NAME",
),
)
op.drop_column("team", "num")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Add optional email to subject

Revision ID: e0c97995e669
Revises: d0e0719b1939
Create Date: 2024-05-01 14:23:11.789984

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'e0c97995e669'
down_revision: Union[str, None] = 'd0e0719b1939'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('project', 'publish_date',
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=True,
existing_server_default=sa.text('CURRENT_TIMESTAMP'))
op.add_column('subject', sa.Column('email', sa.String(), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('subject', 'email')
op.alter_column('project', 'publish_date',
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=False,
existing_server_default=sa.text('CURRENT_TIMESTAMP'))
# ### end Alembic commands ###
4 changes: 2 additions & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
cryptography==42.0.5
docker==7.0.0
docker==7.1.0
exceptiongroup==1.1.2
fastapi==0.109.2
greenlet==3.0.3
Expand Down Expand Up @@ -45,7 +45,7 @@ python-cas==1.6.0
python-dotenv==1.0.1
python-multipart==0.0.9
PyYAML==6.0.1
requests==2.31.0
requests==2.32.2
six==1.16.0
sniffio==1.3.0
SQLAlchemy==2.0.27
Expand Down
6 changes: 5 additions & 1 deletion backend/src/auth/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@ async def token(
if not user or not attributes:
raise UnAuthenticated(detail="Invalid CAS ticket")
# Create user if not exists
if not await user_service.get_by_id(db, attributes["uid"]):
resolved_user = await user_service.get_by_id(db, attributes["uid"])
if not resolved_user:
await user_service.create_user(
db,
UserCreate(
given_name=attributes["givenname"],
surname=attributes["surname"],
uid=attributes["uid"],
mail=attributes["mail"],
),
)
elif resolved_user.surname == 'SURNAME_DEFAULT':
resolved_user.surname = attributes["surname"]

# Create JWT token
jwt_token = create_jwt_token(attributes["uid"])
Expand Down
20 changes: 20 additions & 0 deletions backend/src/docker_tests/dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Generator, Any

import docker
from docker import DockerClient
from docker.errors import DockerException

from src.docker_tests.exceptions import DockerDeamonNotFound


def get_docker_client() -> Generator[DockerClient, Any, None]:
"""Creates docker client, which is closed afterwards"""
try:
client = docker.from_env()
except DockerException:
raise DockerDeamonNotFound()

try:
yield client
finally:
client.close()
Loading
Loading