Skip to content

Commit

Permalink
fix novice retreat behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
realsuayip committed Sep 27, 2020
1 parent 34ee70a commit 8d7f4a6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
[0.14.7-alpha](2020.09.27)(compatible)
--Additions--
None

-- Changes --
1) When the number of entries dropped
below 10, novices wouldn't be kicked out
of the novice list, fixed that.
2) Fixed incorrect argument for date_created
field of Conversation. (run makemigrations+migrate
for dictionary)
3) Reduced entry deletion karma penalty by 1.

--Deletions--
None

[0.14.6-alpha](2020.09.26)(compatible)
--Additions--
1) Add filtering by media in Topic
Expand Down
2 changes: 1 addition & 1 deletion dictionary/models/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def delete(self, *args, **kwargs):
self.author.application_status = "OH"
self.author.application_date = None
self.author.queue_priority = 0
self.author.save()
self.author.save(update_fields=["application_status", "application_date", "queue_priority"])

def update_vote(self, rate, change=False):
k = Decimal("2") if change else Decimal("1")
Expand Down
2 changes: 1 addition & 1 deletion dictionary/models/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ConversationArchive(models.Model):
slug = models.SlugField()

messages = models.TextField() # json text
date_created = models.DateTimeField(auto_now=True)
date_created = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f"{self.__class__.__name__} holder -> {self.holder.username} target -> {self.target}"
Expand Down
2 changes: 1 addition & 1 deletion dictionary/templates/dictionary/includes/devinfo.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="mt-3">
<code>
<a rel="noopener" target="_blank" href="https://github.com/realsuayip/django-sozluk">
<span>django-sozluk 0.14.6-alpha</span>
<span>django-sozluk 0.14.7-alpha</span>
</a>
<small class="d-block">committer's Python version: 3.8.5</small>
</code>
Expand Down
4 changes: 2 additions & 2 deletions dictionary_graph/entry/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def mutate(_root, info, entry):

if not entry.is_draft:
# Deduct some karma upon entry deletion.
info.context.user.karma = F("karma") - 2
info.context.user.save()
entry.author.karma = F("karma") - 1
entry.author.save(update_fields=["karma"])

return DeleteEntry(feedback=_("your entry has been deleted"), redirect=redirect_url)

Expand Down

0 comments on commit 8d7f4a6

Please sign in to comment.