-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add ANAF GDPR flag conversion and include in CSV export #541
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
Conversation
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.
Pull Request Overview
Adds support for an ANAF GDPR consent flag by converting its boolean value to an integer and exposing it in both the CSV export and the accompanying template documentation.
- Introduce
anaf_gdpr_flag_to_int
inclean.py
- Update the HTML template to document the new CSV column
- Wire the new flag into the CSV export logic and header
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
backend/templates/v2/DESCRIERE.html | Document the new “ANAF GDPR” column in the index.csv description |
backend/redirectioneaza/common/clean.py | Add anaf_gdpr_flag_to_int and annotate normalize_text_alnum |
backend/donations/views/download_donations/main.py | Import and apply the new flag conversion; include it in CSV output |
Comments suppressed due to low confidence (2)
backend/donations/views/download_donations/main.py:205
- [nitpick] Consistently capitalize the CSV header to match the template label (e.g., use
_("ANAF GDPR")
) so it aligns with the displayed column name.
_("anaf gdpr"),
backend/redirectioneaza/common/clean.py:22
- Consider adding unit tests for
anaf_gdpr_flag_to_int
to verify bothTrue
/False
paths convert to1
/0
as expected.
def anaf_gdpr_flag_to_int(anaf_gdpr: bool) -> int:
@@ -92,7 +100,7 @@ def clean_text_custom(text: str) -> str: | |||
return "".join([c for c in text if c in ANAF_CUSTOM_LIST]) | |||
|
|||
|
|||
def normalize_text_alnum(text): | |||
def normalize_text_alnum(text) -> str: |
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.
Add a type annotation for the text
parameter (e.g., text: str
) to keep consistency and clarity of function signatures.
def normalize_text_alnum(text) -> str: | |
def normalize_text_alnum(text: str) -> str: |
Copilot uses AI. Check for mistakes.
from redirectioneaza.common.clean import anaf_gdpr_flag_to_int, duration_flag_to_int, normalize_text_alnum | ||
from redirectioneaza.common.messaging import extend_email_context, send_email |
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.
[nitpick] Align this import with other imports by removing the extra leading space and grouping imports according to project style (e.g., one import per line or sorted alphabetically).
from redirectioneaza.common.clean import anaf_gdpr_flag_to_int, duration_flag_to_int, normalize_text_alnum | |
from redirectioneaza.common.messaging import extend_email_context, send_email | |
from redirectioneaza.common.clean import anaf_gdpr_flag_to_int | |
from redirectioneaza.common.clean import duration_flag_to_int | |
from redirectioneaza.common.clean import normalize_text_alnum | |
from redirectioneaza.common.messaging import extend_email_context | |
from redirectioneaza.common.messaging import send_email |
Copilot uses AI. Check for mistakes.
No description provided.