Selaa lähdekoodia

edit team join apps to not require a star

Kylie Jo Swistak 5 vuotta sitten
vanhempi
commit
52774fd3de
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      app/app_forms/team_join_app.rb

+ 7 - 1
app/app_forms/team_join_app.rb

@@ -5,7 +5,13 @@ class TeamJoinApplication < ApplicationForm
     @process ||= Application.new('Team Join Request') do |event|
       # Calculate majority and check votes
       maj = majority(event)
-      check_votes(event, maj)
+
+      # Check votes
+      if reactions[Emoji::Y]&.count.to_i > maj
+        approve(event)
+      elsif reactions[Emoji::N]&.count.to_i > maj
+        deny(event)
+      end
 
     rescue StandardError => e
       error_embed(e.message)