-
Notifications
You must be signed in to change notification settings - Fork 51
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
Convert business units to DB table #992
Conversation
@@ -94,21 +94,13 @@ class GeneralSnippetsTimecardSerializer(serializers.Serializer): | |||
) | |||
hours_spent = serializers.DecimalField(max_digits=5, decimal_places=2) | |||
notes = serializers.CharField() | |||
unit = serializers.SerializerMethodField() |
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.
We had already defined unit
on L88
tock/employees/admin.py
Outdated
@@ -65,7 +65,7 @@ class UserDataAdmin(admin.ModelAdmin): | |||
search_fields = ('user__username',) | |||
|
|||
def unit_info(self, obj): | |||
return obj.get_unit_display() | |||
return obj.unit.name |
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.
This needs to check for None
object. It is currently breaking the admin interface.
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.
Nice catch Amy! Updated, and added a comment.
Codecov Report
@@ Coverage Diff @@
## master #992 +/- ##
==========================================
+ Coverage 91.52% 91.60% +0.07%
==========================================
Files 39 39
Lines 1699 1691 -8
==========================================
- Hits 1555 1549 -6
+ Misses 144 142 -2
Continue to review full report at Codecov.
|
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.
LGTM!
Merging this PR, something is not quite working in Snyk. There's no manifest changes. |
Description
Resolves #965 and converts business units to a DB table instead of choices, along with updated tests and fixtures. Also cleans up some tech debt around how orgs are defined and used.