-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c89fab5
commit d74c50c
Showing
7 changed files
with
499 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Constants for memory sizes | ||
KIBIBYTE = 1024 | ||
MEBIBYTE = KIBIBYTE * 1024 | ||
GIBIBYTE = MEBIBYTE * 1024 | ||
TEBIBYTE = GIBIBYTE * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from civil_society_vote.common.contants import GIBIBYTE, KIBIBYTE, MEBIBYTE, TEBIBYTE | ||
|
||
|
||
def get_human_readable_size(num_bytes: int): | ||
if num_bytes >= TEBIBYTE: | ||
size_unit = "TB" | ||
size_in_unit = num_bytes / TEBIBYTE | ||
elif num_bytes >= GIBIBYTE: | ||
size_unit = "GB" | ||
size_in_unit = num_bytes / GIBIBYTE | ||
elif num_bytes >= MEBIBYTE: | ||
size_unit = "MB" | ||
size_in_unit = num_bytes / MEBIBYTE | ||
elif num_bytes >= KIBIBYTE: | ||
size_unit = "KB" | ||
size_in_unit = num_bytes / KIBIBYTE | ||
else: | ||
size_unit = "B" | ||
size_in_unit = num_bytes | ||
|
||
return {"size": size_in_unit, "unit": size_unit} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
209 changes: 209 additions & 0 deletions
209
backend/hub/migrations/0068_alter_candidate_criminal_record_alter_candidate_cv_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
# Generated by Django 4.2.16 on 2024-10-29 14:33 | ||
|
||
from django.db import migrations, models | ||
import hub.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0067_remove_organization_user"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="criminal_record", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="(Optional) Criminal record, valid at the time of submitting the candidacy", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Criminal record", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="cv", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Europass format CV", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="CV", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="declaration_of_interests", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Official format Declaration of interests", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Declaration of interests", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="fiscal_record", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Fiscal record, valid at the time of submitting the candidacy", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Fiscal record", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="letter_of_intent", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Letter of intent (with the mention of the domain to be represented in the CES)", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Letter of intent", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="mandate", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Mandate from the organization (signed in original + electronic) with the highlighting of the domain for which it is running", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Mandate", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="photo", | ||
field=models.ImageField( | ||
blank=True, | ||
default="", | ||
max_length=300, | ||
storage=hub.models.select_public_storage, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Candidate photo", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="statement", | ||
field=models.FileField( | ||
blank=True, | ||
help_text="Declaration of the designated representative stating that he/she is not a member of the leadership of a political party, has not been elected to a public office and is not a dignitary of the Romanian state.", | ||
max_length=300, | ||
null=True, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Representative statement", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="fiscal_certificate_anaf", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Certificat fiscal emis de ANAF", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Fiscal certificate ANAF", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="fiscal_certificate_local", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Certificat fiscal emis de Direcția de Impozite și Taxe Locale", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Fiscal certificate local", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="report_2021", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Rapoartele anuale trebuie să includă sursele de finanțare din care să rezulte că organizația dispune de resurse financiare şi umane pentru îndeplinirea mandatului de membru în Comisia Electorală a VotONG.", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Yearly report 2021", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="report_2022", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Rapoartele anuale trebuie să includă sursele de finanțare din care să rezulte că organizația dispune de resurse financiare şi umane pentru îndeplinirea mandatului de membru în Comisia Electorală a VotONG.", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Yearly report 2022", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="report_2023", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Rapoartele anuale trebuie să includă sursele de finanțare din care să rezulte că organizația dispune de resurse financiare şi umane pentru îndeplinirea mandatului de membru în Comisia Electorală a VotONG.", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Yearly report 2023", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="statement_discrimination", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Declarație pe proprie răspundere prin care declară că nu realizează activități sau susține cauze de natură politică sau care discriminează pe considerente legate de etnie, rasă, sex, orientare sexuală, religie, capacități fizice sau psihice sau de apartenența la una sau mai multe categorii sociale sau economice.", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Non-discrimination statement", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="statement_political", | ||
field=models.FileField( | ||
blank=True, | ||
default="", | ||
help_text="Declarație pe propria răspundere prin care declar că ONG-ul nu are între membrii conducerii organizației (Președinte sau Consiliul Director) membri ai conducerii unui partid politic sau persoane care au fost alese într-o funcție publică.", | ||
max_length=300, | ||
upload_to="", | ||
validators=[hub.models.file_validator], | ||
verbose_name="Non-political statement", | ||
), | ||
), | ||
] |
Oops, something went wrong.