-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add management command for costs report pre-validation #610
Conversation
1 similar comment
from datetime import datetime | ||
|
||
|
||
def valid_date(date_): |
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.
It is in utils already: https://github.com/allegro/ralph_pricing/blob/develop/src/ralph_scrooge/utils/common.py#L130 ;) What about importing it as valid_date
to your mgmt command..?
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.
True, I'll fix it :)
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.
done
e902be4
to
910ecba
Compare
1 similar comment
|
||
from django.core.management.base import BaseCommand | ||
|
||
from ralph_scrooge.utils.common import validate_date |
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.
s/validate_date/validate_date as valid_date/
def add_arguments(self, parser): | ||
parser.add_argument( | ||
'--date', | ||
type=validate_date, |
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.
s/validate_date/valid_date/
class Command(BaseCommand): | ||
""" | ||
Detect if there is cycle in charging between PricingServices for given date | ||
""" | ||
def add_arguments(self, parser): | ||
parser.add_argument( | ||
'--date', | ||
type=valid_date, | ||
type=validate_date, |
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.
s/validate_date/valid_date/
from django.core.management.base import BaseCommand | ||
|
||
from ralph_scrooge.utils.common import validate_date |
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.
s/validate_date/validate_date as valid_date/
@xor-xor fixed all comments |
No description provided.