-
Notifications
You must be signed in to change notification settings - Fork 8
258 allow to manage multiple documents #265
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
base: master
Are you sure you want to change the base?
Conversation
6de2b54
to
081d8f2
Compare
00ac2b3
to
03b78c3
Compare
74438dc
to
4f08bdf
Compare
4f08bdf
to
f7c3707
Compare
Since we pass "CV" as document type in Lines 510 to 513 in 0801752
and in Lines 911 to 915 in 0801752
All documents uploaded to via the form on /candidate will be marked it as a 'CV' type Lines 188 to 194 in 0801752
|
73cb6d8
to
3dc5cae
Compare
interview/forms.py
Outdated
@@ -36,7 +37,9 @@ class Meta: | |||
helper = FormHelper() | |||
exclude = ("anonymized", "anonymized_hashed_name", "anonymized_hashed_email") | |||
|
|||
cv = forms.FileField(label="CV (pour une candidature)", required=False) | |||
candidate_documents = forms.FileField( | |||
label="Documents (CV / Lettre de motivation / Autre)", required=False, widget=UploadFilesWidget() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label need to be translatable, and the base value is in english
@@ -94,7 +94,9 @@ <h4> {% trans 'Process information' %}</h4> | |||
<dd> | |||
<ul> | |||
{% for d in documents %} | |||
<li> <a href="{{ d.content.url }}" > {{ d.document_type }}</a> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove blank lines
interview/tests.py
Outdated
@@ -754,6 +755,104 @@ def setUp(self): | |||
self.fake = faker.Faker() | |||
|
|||
self.tz = pytz.timezone("Europe/Paris") | |||
seed = 72775 | |||
random.seed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need random => Rewrite test to avoid using it
Using random with a seed means we can write directly the random value, and it will be easier to readiness
pyoupyou/urls.py
Outdated
@@ -60,6 +60,11 @@ | |||
views.delete_document_minute_ajax, | |||
name="delete-document-minute", | |||
), | |||
re_path( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to line break, character count < 120
interview/views.py
Outdated
@@ -261,6 +261,11 @@ def process(request, process_id, slug_info=None): | |||
goal = last_itw.goal | |||
|
|||
documents = process.candidate.document_set.all() | |||
|
|||
doc_type_verbose_map = dict(Document.DOCUMENT_TYPE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can avoid it and use directly in template get_FOO_display
https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display
interview/views.py
Outdated
@@ -730,6 +739,19 @@ def delete_document_minute_ajax(request): | |||
return JsonResponse({}) | |||
|
|||
|
|||
@login_required | |||
@require_http_methods(["POST"]) | |||
def delete_document_ajax(request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we delete documents directly and not when we save the form. We can just mark them for deletion
826dd3b
to
aeeccc3
Compare
No description provided.