-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement lending system #3501
base: master
Are you sure you want to change the base?
Implement lending system #3501
Conversation
51b526c
to
d9db172
Compare
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 need an image field in lendableObject
, and responsibleRole
needs to support multiple roles (and should then be called responsibleRoles
)
ABA-613 Lending system
Backup has requested a lending system, as Abakus has a lot of objects that could be lent out to Ababeads if we just had a good system for it. Arrkom also wants this system to make it easier to administrate Soundboks and grill lending. |
d01e557
to
69ee849
Compare
37e3a49
to
53ca393
Compare
53ca393
to
e379fb9
Compare
e379fb9
to
0c729d5
Compare
…mplement-lending-system # Conflicts: # lego/apps/lending/managers.py # lego/apps/lending/models.py # lego/apps/lending/serializers.py # lego/apps/lending/views.py
lego/apps/lending/migrations/0005_alter_lendableobject_responsible_roles.py
Outdated
Show resolved
Hide resolved
@eikhr I'll look closer at the comments after the 2 upcoming exams 👍👍 |
4b3ad08
to
2fa3ee6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3501 +/- ##
==========================================
+ Coverage 88.20% 88.73% +0.53%
==========================================
Files 666 696 +30
Lines 21069 21726 +657
==========================================
+ Hits 18584 19279 +695
+ Misses 2485 2447 -38 ☔ View full report in Codecov by Sentry. |
2fa3ee6
to
afc32a3
Compare
@eikhr I've fixed your comments, notifications still don't work so they are removed for now. Will squash when merged. |
44e4af1
to
cd58144
Compare
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 something weird has happened during a rebase maybe? A lot of unrelated changes in the diff
def get_reactions_grouped(self, user): | ||
grouped = {} | ||
for reaction in self.reactions.all(): | ||
if reaction.emoji.pk not in grouped: | ||
grouped[reaction.emoji.pk] = { | ||
"emoji": reaction.emoji.pk, | ||
"unicode_string": reaction.emoji.unicode_string, | ||
"count": 0, | ||
"has_reacted": False, | ||
"reaction_id": None, | ||
} | ||
|
||
grouped[reaction.emoji.pk]["count"] += 1 | ||
|
||
if reaction.created_by == user: | ||
grouped[reaction.emoji.pk]["has_reacted"] = True | ||
grouped[reaction.emoji.pk]["reaction_id"] = reaction.id | ||
|
||
return sorted(grouped.values(), key=lambda kv: kv["count"], reverse=True) |
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.
What's going on here? Why is this in this PR?
@@ -44,6 +46,33 @@ class Meta: | |||
"additional_emails", | |||
) | |||
|
|||
def validate(self, attrs: Any) -> Any: |
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.
And this stuff has nothing to do with the lending system
Hmm actually I merged instead of rebasing, how can I resolve it now? |
I don't know, I haven't seen this before. |
Resolves ABA-613