Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project Allocator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edtech
Project Allocator
Commits
9257d648
Commit
9257d648
authored
2 years ago
by
ld507
Committed by
Ivan Procaccini
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Feat: Hiding students proposed projects from students that did not propose them
parent
61ef8c8e
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Feat: Hiding students proposed projects from students that did not propose them
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/views/student.py
+8
-3
8 additions, 3 deletions
app/views/student.py
with
8 additions
and
3 deletions
app/views/student.py
+
8
−
3
View file @
9257d648
from
flask
import
Blueprint
,
flash
,
redirect
,
render_template
,
request
,
url_for
from
flask_login
import
current_user
,
login_required
from
sqlalchemy
import
or_
from
app
import
messages
from
app.database
import
db
...
...
@@ -14,9 +15,13 @@ bp = Blueprint("student", __name__, url_prefix="/student")
@login_required
@students_only
def
projects
():
active_projects
:
list
[
Project
]
=
Project
.
query
.
filter
(
Project
.
deleted
.
is_
(
None
)
).
all
()
active_projects
:
list
[
Project
]
=
(
Project
.
query
.
filter
(
or_
(
Project
.
on_behalf
.
is_
(
None
),
Project
.
on_behalf
==
current_user
.
username
)
)
.
filter
(
Project
.
deleted
.
is_
(
None
))
.
all
()
)
short_listings
=
Shortlisting
.
query
.
filter_by
(
student
=
current_user
.
username
).
all
()
short_listings
=
{
s
.
project_id
for
s
in
short_listings
}
return
render_template
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment