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

Master to dev #426

Merged
merged 6 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions files/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.contrib import admin
from django.forms import ModelForm, FileField
from django.db.models import QuerySet

from files.service import CDN, SelectelSwiftStorage
from files.models import UserFile
Expand Down Expand Up @@ -81,3 +82,9 @@ def delete_queryset(self, request, queryset):
for obj in queryset:
self.cdn.delete(obj.link)
queryset.delete()

def get_queryset(self, request) -> QuerySet[UserFile]:
qs = super().get_queryset(request)
if request.user.groups.filter(name="Руководитель программы").exists():
return qs.filter(user=request.user)
return qs
2 changes: 1 addition & 1 deletion vacancy/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class VacancyManager(Manager):
def get_vacancy_for_list_view(self):
expiration_check = datetime.datetime.now() - datetime.timedelta(days=30)
expiration_check = datetime.datetime.now() - datetime.timedelta(days=90)
return (
self.get_queryset()
.select_related("project")
Expand Down
Loading